[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.14.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:
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 file [length]
- C Function: scm_truncate_file (file, length)
Truncate file to length bytes. file can be a filename string, a port object, or an integer file descriptor. The return value is unspecified.
For a port or file descriptor length can be omitted, in which case the file is truncated at the current position (per
ftell
above).On most systems a file can be extended by giving a length greater than the current size, but this is not mandatory in the POSIX standard.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.