seek — sets the file position for reading or writing.
seek (file, offset, where)
- A file pointer to a previously opened
file. This may be either a file in the file system,
or a string opened for read and
- An integer specifying the number of characters into the file, starting from where.
A starting point, indicated by a
- 0 Beginning
of the file.
- 1 Current
position in the file.
- 2 End of the
t if successful,
This function lets you
specify a position in a file to start reading or writing.
The file "myseekfile" contains the following:
Now is the time for all good men and women
to come to the aid of their world.
Gamma> msk = open("myseekfile.dat", "r",nil);
Gamma> seek(msk, 5, 0);
"s the time for all good men and women"
Gamma> seek(msk, 2, 1);
" come to the aid of their world."
Gamma> seek(msk, -15, 2);
"of their world."
Gamma> seek(msk, -3, 0);
read, read_char, read_double,