diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-10-27 14:23:38 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-10-27 14:23:38 (GMT) |
commit | 45beb64f7dcb09a6ce83532702bca760f72e6f4d (patch) | |
tree | f7746a2a8316d612570e1456524e3d182e855c82 /doc/read.n | |
parent | 5bc57d7b0f63d86fc383565d69f7704943fff94d (diff) | |
download | tcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.zip tcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.tar.gz tcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.tar.bz2 |
Yet more doc update backporting
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) |