fcopy(3tcl) Tcl Built-In Commands fcopy(3tcl) ______________________________________________________________________________ NAME fcopy - SYNOPSIS fcopy inchan outchan ?-size size? ?-command callback? ______________________________________________________________________________ DESCRIPTION fcopy I/O inchan I/O outchan fcopy Tcl I/O (leverage) fcopy inchan size -size inchan outchan -command outchan fcopy -command fcopy callback callback outchan inchan outchan fcopy vwait Tk inchan outchan I/O inchan outchan inchan outchan (queue) inchan fileevent(interfere) fileevent I/O "channel busy" Fcopy inchan outchan -translationfconfigure -translation inchan outchan. outchan fcopy fcopy EXAMPLE vwait proc Cleanup {in out bytes {error {}}} { global total set total $bytes close $in close $out if {[string length $error] != 0} { # error occurred during the copy } } set in [open $file1] set out [socket $server $port] fcopy $in $out -command [list Cleanup $in $out] vwait total (chunk) proc CopyMore {in out chunk bytes {error {}}} { global total done incr total $bytes if {([string length $error] != 0) || [eof $in] { set done $total close $in close $out } else { fcopy $in $out -command [list CopyMore $in $out $chunk] \ -size $chunk } } set in [open $file1] set out [socket $server $port] set chunk 1024 set total 0 fcopy $in $out -command [list CopyMore $in $out $chunk] -size $chunk vwait done SEE ALSO eof(n), fblocked(n), fconfigure(n) KEYWORDS blocking, channel, end of line, end of file, nonblocking, read, translation [] [] 2001/08/02 Linux man : http://cmpp.linuxforum.net man man https://github.com/man-pages-zh/manpages- zh Tcl 8.0 fcopy(3tcl)