summaryrefslogtreecommitdiffstats
path: root/doc/read.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:23:38 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:23:38 (GMT)
commit45beb64f7dcb09a6ce83532702bca760f72e6f4d (patch)
treef7746a2a8316d612570e1456524e3d182e855c82 /doc/read.n
parent5bc57d7b0f63d86fc383565d69f7704943fff94d (diff)
downloadtcl-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.n12
1 files changed, 10 insertions, 2 deletions
diff --git a/doc/read.n b/doc/read.n
index b80f134..18e3d79 100644
--- a/doc/read.n
+++ b/doc/read.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: 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)