The function fseek positions the file cursor to a new location. The parameter stream is a file pointer defining the file. The parameter offset is a long value defining the number of bytes to move. The parameter origin is an integer defining the file cursor location. The function is included in the library RL-FlashFS. The prototype is defined in the file stdio.h. The parameter origin can have one of the following values: | Origin Value | Description |
|---|
| SEEK_CUR | Current position of the file cursor. | | SEEK_END | End of the file. | | SEEK_SET | Beginning of the file. |
The file must be opened for reading. Seeking within files opened for writing is not supported. The file cursor can be positioned anywhere within the file or past the end of the file. Attempts to position the file cursor before the beginning of the file causes an error. |