Next: Port Redirection, Previous: Opening and Closing, Up: Files and Ports [Contents][Index]
Returns #t if port is closed.
If obj is not a port returns false, otherwise returns a symbol describing the port type, for example string or pipe.
Returns the filename port was opened with. If port is not open to a file the result is unspecified.
Returns the current position of the character in port which will
next be read or written. If port is open to a non-file then
#f
is returned.
Sets the current position in port which will next be read or
written. If successful, #f
is returned. If port is open
to a non-file, then file-position
returns #f
.
If port is a tracked port, return the current line (column) number,
otherwise return #f
. Line and column numbers begin with 1.
The column number applies to the next character to be read; if that
character is a newline, then the column number will be one more than
the length of the line.
Outputs a newline to optional argument port unless the current
output column number of port is known to be zero, ie output will
start at the beginning of a new line. port defaults to
current-output-port
. If port is not a tracked port
freshline
is equivalent to newline
.
Returns #t
if port is input or output to a serial non-file
device.
Returns #t
if a character is ready on the input port and
returns #f
otherwise. If char-ready?
returns #t
then
the next read-char
operation on the given port is
guaranteed
not to hang. If the port is at end of file then
char-ready?
returns #t
.
Port may be omitted, in which case it defaults to
the value returned by current-input-port
.
Rationale Char-ready?
exists to make it possible for a
program to
accept characters from interactive ports without getting stuck waiting
for input. Any input editors associated with such ports must ensure
that characters whose existence has been asserted by char-ready?
cannot be rubbed out. If char-ready?
were to return #f
at
end of file, a port at end of file would be indistinguishable from an
interactive port that has no ready characters.
Returns a list those ports port1 … which are char-ready?
.
If none of port1 … become char-ready?
within the time
interval of x seconds, then #f is returned. The
port1 … arguments may be omitted, in which case they default
to the list of the value returned by current-input-port
.
Next: Port Redirection, Previous: Opening and Closing, Up: Files and Ports [Contents][Index]