File input and output commands
These commands include those to search ASCII-sorted data files,
copy files, duplicate file descriptors,
control file access options, retrieve open
file status, and create pipes with the pipe system call.
An interface to the select system call is available on
UNIX systems that support it.
Tcl file I/O is implemented on top of the stdio library.
By default, the file is buffered.
When communicating to a process through a pipe, a flush
command should be issued to force the data out.
Alternatively, the fcntl command may be used to set the buffering
mode of a file to line-buffered or unbuffered.
Available commands are:
bsearch(TCL)- 
searchs an open file for a match
 
close(TCL)- 
closes an open file
 
copyfile(TCL)- 
copies the remainder of file1 to file2
 
dup(TCL)- 
duplicates an open file
 
eof(TCL)- 
checks for an end-of-file condition on an open file
 
fcntl(TCL)- 
sets, clears, or returns file options
 
file(TCL)- 
manipulates file names and attributes
 
flock(TCL)- 
creates a lock on all or part of a file
 
flush(TCL)- 
flushes buffered output for a file
 
for_file(TCL)- 
implements a loop over contents of a file
 
funlock(TCL)- 
removes a lock created by
flock(TCL)
 
frename(TCL)- 
renames an old path to a new path
 
fstat(TCL)- 
obtains status information on an open file
 
gets(TCL)- 
reads a line from a file
 
lgets(TCL)- 
reads the next Tcl list from a file and discards the terminating newline
 
open(TCL)- 
opens a file
 
pipe(TCL)- 
creates a pipe
 
puts(TCL)- 
writes to a file
 
read(TCL)- 
reads from a file
 
read_file(TCL)- 
reads a file and returns its contents as a string
 
select(TCL)- 
waits for files to come available or satisfy conditions
 
seek(TCL)- 
changes the access position for an open file
 
tell(TCL)- 
returns the current access position for an open file
 
write_file(TCL)- 
writes strings to a specified file
 
Next topic: 
List handling commands
Previous topic: 
Information commands
© 2003 Caldera International, Inc.  All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003