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 write.
An integer specifying the number of characters into the file, starting from where.
A starting point, indicated by a number:
0 Beginning of the file.
1 Current position in the file.
2 End of the file.
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); #<File:"myseekfile.dat"> Gamma> seek(msk, 5, 0); t Gamma> read_line(msk); "s the time for all good men and women" Gamma> seek(msk, 2, 1); t Gamma> read_line(msk); " come to the aid of their world." Gamma> seek(msk, -15, 2); t Gamma> read_line(msk); "of their world." Gamma> seek(msk, -3, 0); nil Gamma>
open, open_string, read, read_char, read_double, read_float, read_line, read_long, read_short, read_until, tell
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.