fseekmark()
PROTOTYPE
#include <stdio.h>
int fseekmark(FILE *file, int disable_update);
DESCRIPTION
fseekmark() is a non-standard routine that saves the current position of the open regular file specified by file and controls whether later seeks overwrite the saved position. Seeks start from a file’s beginning, end, current position, or saved position; whichever is at or before the requested offset and the closest to it. By default, the current position is saved before each seek.
This usually gives good performance. However, when the current file position is an optimum starting point for later seeks, calling fseekmark() with disable non-zero updates the saved position and prevents it from being overwritten by later seeks.
To update the saved position and restore the default behavior, which updates the saved position before every seek, call fseekmark() with zero for disable_update. See Optimizing Seeks for more information.
If successful, fseekmark() returns 0. Otherwise, it sets errno and returns -1.
ERROR CODES
| EBADF | file is not the handle of an open file. |
| EISDIR | The specified file is a directory. |
EXAMPLE
/*---------------------------------------------------------------*/
/* Save the starting position of the music header structure. */
/*---------------------------------------------------------------*/
fseekmark(file, TRUE);