diff options
author | dkf <dkf@noemail.net> | 2004-10-27 14:23:38 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2004-10-27 14:23:38 (GMT) |
commit | 283036b2fce11f6302bae2d3b3b2f00217546af9 (patch) | |
tree | f7746a2a8316d612570e1456524e3d182e855c82 /doc/read.n | |
parent | 46669897decc1c69eb2226d713c9ddaa026431ec (diff) | |
download | tcl-283036b2fce11f6302bae2d3b3b2f00217546af9.zip tcl-283036b2fce11f6302bae2d3b3b2f00217546af9.tar.gz tcl-283036b2fce11f6302bae2d3b3b2f00217546af9.tar.bz2 |
Yet more doc update backporting
FossilOrigin-Name: 437d4766e451250d467d2b0c470b7c21a7ac2e2c
Diffstat (limited to 'doc/read.n')
-rw-r--r-- | doc/read.n | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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: read.n,v 1.7 2001/09/14 19:20:40 andreas_kupries Exp $ +'\" RCS: @(#) $Id: read.n,v 1.7.8.1 2004/10/27 14:23:57 dkf Exp $ '\" .so man.macros .TH read n 8.1 Tcl "Tcl Built-In Commands" @@ -73,7 +73,15 @@ In this form \fBread\fR blocks until the reception of the end-of-file character, see \fBfconfigure -eofchar\fR. If there no end-of-file character has been configured for the channel, then \fBread\fR will block forever. - +.SH "EXAMPLE" +This example code reads a file all at once, and splits it into a list, +with each line in the file corresponding to an element in the list: +.CS +set fl [open /proc/meminfo] +set data [\fBread\fR $fl] +close $fl +set lines [split $data \\n] +.CE .SH "SEE ALSO" file(n), eof(n), fblocked(n), fconfigure(n), Tcl_StandardChannels(3) |