Posted to tcl by saedelaere at Tue Dec 08 08:15:28 GMT 2009view raw
- button .b -text test
- grid .b
- tkwait visibility .
-
- proc CopyMore {in out chunk bytes {error {}}} {
- global total done
- incr total $bytes
- puts "bytes $bytes"
- puts "error $error"
- puts "total $total"
- if {([string length $error] != 0) || [eof $in]} {
- set done $total
- puts "done $done"
- close $in
- close $out
- } else {
- fcopy $in $out -size $chunk \
- -command [list CopyMore $in $out $chunk]
- }
- }
-
- set file1 /home/saedelaere/ul_suedamerika_rework
- set file2 /home/saedelaere/ul_suedamerika_rework2
-
- set in [open $file1 r]
- set out [open $file2 w+]
- set chunk 8192
- set total 0
- puts [file size $file1]
-
- fcopy $in $out -size $chunk \
- -command [list CopyMore $in $out $chunk]