DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

read(TCL)


read -- read from a file

Syntax

read [-nonewline] fileId

read fileId numBytes

Description

In the first form, all of the remaining bytes are read from the file given by fileId; they are returned as the result of the command. If the -nonewline switch is specified then the last character of the file is discarded if it is a newline. In the second form, the extra argument specifies how many bytes to read; exactly this many bytes will be read and returned, unless there are fewer than numBytes bytes left in the file; in this case, all the remaining bytes are returned. fileId must be stdin or the return value from a previous call to open; it must refer to a file that was opened for reading. Any existing end-of-file or error condition on the file is cleared at the beginning of the read command.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003