(guile.info.gz) Random Access
Info Catalog
(guile.info.gz) Closing
(guile.info.gz) Input and Output
(guile.info.gz) Line/Delimited
27.5 Random Access
==================
-- Scheme Procedure: seek fd_port offset whence
-- C Function: scm_seek (fd_port, offset, whence)
Sets the current position of FD/PORT to the integer OFFSET, which
is interpreted according to the value of WHENCE.
One of the following variables should be supplied for WHENCE:
-- Variable: SEEK_SET
Seek from the beginning of the file.
-- Variable: SEEK_CUR
Seek from the current position.
-- Variable: SEEK_END
Seek from the end of the file.
If FD/PORT is a file descriptor, the underlying system call is
`lseek'. PORT may be a string port.
The value returned is the new position in the file. This means
that the current position of a port can be obtained using:
(seek port 0 SEEK_CUR)
-- Scheme Procedure: ftell fd_port
-- C Function: scm_ftell (fd_port)
Return an integer representing the current position of FD/PORT,
measured from the beginning. Equivalent to:
(seek port 0 SEEK_CUR)
-- Scheme Procedure: truncate-file object [length]
-- C Function: scm_truncate_file (object, length)
Truncates the object referred to by OBJECT to at most LENGTH
bytes. OBJECT can be a string containing a file name or an
integer file descriptor or a port. LENGTH may be omitted if
OBJECT is not a file name, in which case the truncation occurs at
the current port. position. The return value is unspecified.
Info Catalog
(guile.info.gz) Closing
(guile.info.gz) Input and Output
(guile.info.gz) Line/Delimited
automatically generated byinfo2html