Random Access
=============
- primitive: seek object 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)
- primitive: fseek object offset whence
Obsolete. Almost the same as seek, above, but the return value is
unspecified.
- primitive: ftell object
Returns an integer representing the current position of FD/PORT,
measured from the beginning. Equivalent to:
(seek port 0 SEEK_CUR)
- primitive: truncate-file object [length]
Truncates the object referred to by OBJ to at most SIZE bytes.
OBJ can be a string containing a file name or an integer file
descriptor or a port. SIZE may be omitted if OBJ is not a file
name, in which case the truncation occurs at the current port.
position.
The return value is unspecified.