diff options
Diffstat (limited to 'doc/fcopy.n')
-rw-r--r-- | doc/fcopy.n | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/doc/fcopy.n b/doc/fcopy.n index 071896c..d39c803 100644 --- a/doc/fcopy.n +++ b/doc/fcopy.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH fcopy n 8.0 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -23,20 +23,23 @@ avoid extra copies and to avoid buffering too much data in main memory when copying large files to slow destinations like network sockets. .PP -The \fBfcopy\fR +The \fBfcopy\fR command transfers data from \fIinchan\fR until end of file -or \fIsize\fR bytes have been -transferred. If no \fB\-size\fR argument is given, +or \fIsize\fR bytes or characters have been +transferred; \fIsize\fR is in bytes if the two channels are using the +same encoding, and is in characters otherwise. +If no \fB\-size\fR argument is given, then the copy goes until end of file. All the data read from \fIinchan\fR is copied to \fIoutchan\fR. Without the \fB\-command\fR option, \fBfcopy\fR blocks until the copy is complete -and returns the number of bytes written to \fIoutchan\fR. +and returns the number of bytes or characters (using the same rules as +for the \fB\-size\fR option) written to \fIoutchan\fR. .PP The \fB\-command\fR argument makes \fBfcopy\fR work in the background. In this case it returns immediately and the \fIcallback\fR is invoked later when the copy completes. The \fIcallback\fR is called with -one or two additional +one or two additional arguments that indicates how many bytes were written to \fIoutchan\fR. If an error occurred during the background copy, the second argument is the error string associated with the error. @@ -109,7 +112,7 @@ fconfigure $out -translation binary This second example shows how the callback gets passed the number of bytes transferred. It also uses vwait to put the application into the event loop. -Of course, this simplified example could be done without the command +Of course, this simplified example could be done without the command callback. .PP .CS @@ -174,3 +177,6 @@ vwait done eof(n), fblocked(n), fconfigure(n), file(n) .SH KEYWORDS blocking, channel, end of line, end of file, nonblocking, read, translation +'\" Local Variables: +'\" mode: nroff +'\" End: |