Posted to tcl by saedelaere at Tue Dec 08 08:15:28 GMT 2009view raw

  1. button .b -text test
  2. grid .b
  3. tkwait visibility .
  4.  
  5. proc CopyMore {in out chunk bytes {error {}}} {
  6. global total done
  7. incr total $bytes
  8. puts "bytes $bytes"
  9. puts "error $error"
  10. puts "total $total"
  11. if {([string length $error] != 0) || [eof $in]} {
  12. set done $total
  13. puts "done $done"
  14. close $in
  15. close $out
  16. } else {
  17. fcopy $in $out -size $chunk \
  18. -command [list CopyMore $in $out $chunk]
  19. }
  20. }
  21.  
  22. set file1 /home/saedelaere/ul_suedamerika_rework
  23. set file2 /home/saedelaere/ul_suedamerika_rework2
  24.  
  25. set in [open $file1 r]
  26. set out [open $file2 w+]
  27. set chunk 8192
  28. set total 0
  29. puts [file size $file1]
  30.  
  31. fcopy $in $out -size $chunk \
  32. -command [list CopyMore $in $out $chunk]