diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2007-10-17 17:31:58 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2007-10-17 17:31:58 (GMT) |
commit | a7740bd0b004e54f0efd820b0bd731e0a8102c76 (patch) | |
tree | a20b322e5734c6f1149f11d275aebdda0c01f867 /doc/fcopy.n | |
parent | 08d7c1eb0bd82b0f1aa5b314d946fde160159f97 (diff) | |
download | tcl-a7740bd0b004e54f0efd820b0bd731e0a8102c76.zip tcl-a7740bd0b004e54f0efd820b0bd731e0a8102c76.tar.gz tcl-a7740bd0b004e54f0efd820b0bd731e0a8102c76.tar.bz2 |
Improve nroff macro usage
Diffstat (limited to 'doc/fcopy.n')
-rw-r--r-- | doc/fcopy.n | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/fcopy.n b/doc/fcopy.n index 77135b9..81ea603 100644 --- a/doc/fcopy.n +++ b/doc/fcopy.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: fcopy.n,v 1.10 2007/07/04 14:45:19 dkf Exp $ +'\" RCS: @(#) $Id: fcopy.n,v 1.11 2007/10/17 17:31:58 dkf Exp $ '\" .so man.macros .TH fcopy n 8.0 Tcl "Tcl Built-In Commands" @@ -94,18 +94,18 @@ The first example transfers the contents of one channel exactly to another. Note that when copying one file to another, it is better to use \fBfile copy\fR which also copies file metadata (e.g. the file access permissions) where possible. -.DS +.CS fconfigure $in -translation binary fconfigure $out -translation binary \fBfcopy\fR $in $out -.DE +.CE .PP 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 callback. -.DS +.CS proc Cleanup {in out bytes {error {}}} { global total set total $bytes @@ -119,11 +119,11 @@ set in [open $file1] set out [socket $server $port] \fBfcopy\fR $in $out -command [list Cleanup $in $out] vwait total -.DE +.CE .PP The third example copies in chunks and tests for end of file in the command callback -.DS +.CS proc CopyMore {in out chunk bytes {error {}}} { global total done incr total $bytes @@ -143,7 +143,7 @@ set total 0 \fBfcopy\fR $in $out -size $chunk \\ -command [list CopyMore $in $out $chunk] vwait done -.DE +.CE .SH "SEE ALSO" eof(n), fblocked(n), fconfigure(n), file(n) |