Alternate entries: .SEEKB, FSEEK, _FSEEK
B: %b/manif/seek status = .seek( unit, seekint, origin ); /* C users see "expl c lib fseek" */
.SEEK changes to a new read/write position in a file, using a "seek integer" to represent the target position.
If you opened unit with the "zb" option, the seek integer represents a character offset from the "origin". The value of "origin" may be any of the following manifests:
If you did not specify the "zb" option when opening the file, the seek integer has a more complex format. The upper 14 bits represent a logical block number within the file and the bottom 22 bits represent a character offset within that block. Seek integers of this form can be obtained through calls to .TELL. When the seek integer takes this form, "origin" is usually SEEK_SET; if "origin" is SEEK_CUR or SEEK_END, the "offset" must be zero.
Some GCOS8 files are too large for seek integers to be able to address every location in the file. Thus you may be better off to use the library functions .FSPOS and .FGPOS which address locations using "seek structures" instead of seek integers. Seek structures offer a much larger range of addressing.
The .SEEK function will not work on concatenated file strings, i.e. lists of files specified as "file1+file2+file3".
The .SEEK function is now supported on strings that have been opened for I/O.
Copyright © 2000, Thinkage Ltd.