再来一个《The C Programming Language》的附录:
B.1.6 File Positioning Functions
int fseek(FILE *stream, long offset, int origin)
fseek sets the file position for stream; a subsequent read or write will access data beginning at the new position. For a binary file, the position is set to offset characters from origin, which may be SEEK_SET (beginning), SEEK_CUR (current position), or SEEK_END (end of file). For a text stream, offset must be zero, or a value returned by ftell (in which case origin must be SEEK_SET). fseek returns non-zero on error.
long ftell(FILE *stream)
ftell returns the current file position for stream, or -1 on error.
Fedora Core 12下不是这样子哦
The rewind() function returns no value. Upon successful completion, fgetpos(), fseek(), fsetpos() return 0,
and ftell() returns the current offset. Otherwise, -1 is returned and errno is set to indicate the error.