seek: fn(fd: ref FD, off, start: int): int;
## returns the new file offset in bytes.
The start argument can have the following values:
SEEKSTART | The offset is set to off bytes from the start of the file. |
SEEKRELA | The offset is set to its current value plus off bytes. |
SEEKEND | The offset is set to the size of the file plus off bytes. |
The new file offset value is returned.
The seek function does not validate the offset being set. Subsequent read or write calls to an invalid offset will fail.
Seeking in a directory is not allowed.
The current offset for a file is shared among processes of the same file descriptor group. See pctl - process control.
sys->seek (outfd, 0, sys->SEEKEND);