Moves the file pointer to the location indicated by the specified origin and modified by the specified offset.
FSEEK("filename", offset, mode)
"filename" |
- |
A string. The name of the file to move the seek location. |
||||||
offset |
- |
An integer. Position to seek in bytes relative to the mode. |
||||||
mode |
- |
An integer. The position from which the offset is calculated:
|
A 1 if the pointer move is successful; otherwise it returns nothing.
If the file myheader.hdr contains the following:
DATASET Pressure
SERIES PTop, PBottom
then the commands:
fopen("myheader.hdr", "r+")
fseek("myheader.hdr", 18, 0)
fgets("myheader.hdr")
displays the string SERIES PTop, PBottom on the status line.
fseek(filename, 0, 2)
moves the pointer to the end of the file.
File must be opened with FOPEN before using FSEEK. FSEEK changes the read/write position of the file specified by filename.
FTELL can be used to determine the byte position of the file pointer.