closefileId}
Command: close
Close the open file channel fileId.
eoffileId}
Command: eof
Returns 1 if an end-of-file has occurred on fileId, 0 otherwise.
fblockedfileId}
Command: fblocked
Returns 1 if last read from fileId exhausted all available input.
fconfigurefileId [option [value]]}
Command: fconfigure
Sets and gets options for I/O channel fileId. Options are:
-blocking boolean: Whether I/O can block process.
-buffering fullline
one: How to buffer output.
-buffersize byteSize: Size of buffer.
-eofchar char {inCharoutChar:}
Sets character to serve as end-of-file marker.
-translation mode {inModeoutMode:}
Sets how to translate end-of-line markers.
Modes are auto, binary, cr, crlf, and lf.
For socket channels (read-only settings):
-sockname: Returns three element list with
address, host name and port number.
-peername: For client and accepted sockets,
three element list of peer socket.
For serial device channels:
-mode baud,parity,data,stop:
Set baud rate, parity, data bits, and stop bits of channel.
fcopyinIdoutId [-size size] [-command callback]}
Command: fcopy
Transfer data to outId from inId until eof or size
bytes have been transferred. If -command is given, copy occurs
in background and runs callback when finished appending number
of bytes copied and possible error message as arguments.
fileeventfileId readablewritable [script]}
Command: fileevent
Evaluate script when channel fileId becomes readable/writable.
flushfileId}
Command: flush
Flushes any output that has been buffered for fileId.
getsfileId [varName]}
Command: gets
Read next line from channel fileId, discarding newline character.
Places characters of line in varName if given, otherwise returns them.
openfileName [access] [perms]}
Command: open
Opens filename and returns its channel id. If a new file is created,
its permission are set to the conjuction of perms and the process
umask. The access may be
r: Read only. File must exist.
r+: Read and write. File must exist.
w: Write only. Truncate if exists.
w+: Read and write. Truncate if exists.
a: Write only. File must exist. Access position at end.
a+: Read and write. Access position at end.
puts
[-nonewline] [fileId] string}
Command: puts
Write string to fileId (default stdout) optionally omitting newline char.
read
[-nonewline] fileId}
Command: read
Read all remaining bytes from fileId, optionally discarding last
character if it is a newline.
readfileIdnumBytes}
Read numBytes bytes from fileId.
seekfileIdoffset [origin]}
Command: seek
Change current access position on fileId to offset bytes from origin
which may be start, current, or end.
socket
[option ...] hostport}
Command: socket
Open a client-side TCP socket to server host on port. Options are:
-myaddr addr: Set network address of client (if multiple available).
-myport port: Set connection port of client (if different from server).
-async: Make connection asynchronous.
socket
-server command [-myaddr addr] port}
Open server TCP socket on port invoking command once connected.
tellfileId}
Command: tell
Return current access position in fileId.