[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.14.10.7 Input Ports
- Scheme Procedure: input-port? obj
Returns
#t
if the argument is an input port (or a combined input and output port), and returns#f
otherwise.
- Scheme Procedure: port-eof? input-port
Returns
#t
if thelookahead-u8
procedure (if input-port is a binary port) or thelookahead-char
procedure (if input-port is a textual port) would return the end-of-file object, and#f
otherwise. The operation may block indefinitely if no data is available but the port cannot be determined to be at end of file.
- Scheme Procedure: open-file-input-port filename
- Scheme Procedure: open-file-input-port filename file-options
- Scheme Procedure: open-file-input-port filename file-options buffer-mode
- Scheme Procedure: open-file-input-port filename file-options buffer-mode maybe-transcoder
maybe-transcoder must be either a transcoder or
#f
.The
open-file-input-port
procedure returns an input port for the named file. The file-options and maybe-transcoder arguments are optional.The file-options argument, which may determine various aspects of the returned port (see section File Options), defaults to the value of
(file-options)
.The buffer-mode argument, if supplied, must be one of the symbols that name a buffer mode. The buffer-mode argument defaults to
block
.If maybe-transcoder is a transcoder, it becomes the transcoder associated with the returned port.
If maybe-transcoder is
#f
or absent, the port will be a binary port and will support theport-position
andset-port-position!
operations. Otherwise the port will be a textual port, and whether it supports theport-position
andset-port-position!
operations is implementation-dependent (and possibly transcoder-dependent).
- Scheme Procedure: standard-input-port
Returns a fresh binary input port connected to standard input. Whether the port supports the
port-position
andset-port-position!
operations is implementation-dependent.
- Scheme Procedure: current-input-port
This returns a default textual port for input. Normally, this default port is associated with standard input, but can be dynamically re-assigned using the
with-input-from-file
procedure from theio simple (6)
library (see section rnrs io simple). The port may or may not have an associated transcoder; if it does, the transcoder is implementation-dependent.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.