|
|
1.1 ! root 1: .\" @(#)fseek.3 6.5 (Berkeley) 4/1/89 ! 2: .\" ! 3: .TH FSEEK 3 "April 1, 1989" ! 4: .AT 3 ! 5: .SH NAME ! 6: fseek, ftell, rewind \- reposition a stream ! 7: .SH SYNOPSIS ! 8: .B #include <stdio.h> ! 9: .PP ! 10: .B fseek(stream, offset, ptrname) ! 11: .br ! 12: .SM ! 13: .B FILE ! 14: .B *stream; ! 15: .br ! 16: .B long offset; ! 17: .PP ! 18: .B long ftell(stream) ! 19: .br ! 20: .SM ! 21: .B FILE ! 22: .B *stream; ! 23: .PP ! 24: .B rewind(stream) ! 25: .SH DESCRIPTION ! 26: .I Fseek ! 27: sets the position of the next input or output ! 28: operation on the ! 29: .IR stream . ! 30: The new position is at the signed distance ! 31: .I offset ! 32: bytes ! 33: from the beginning, the current position, or the end of the file, ! 34: according as ! 35: .I ptrname ! 36: has the value 0, 1, or 2. ! 37: .PP ! 38: .I Fseek ! 39: undoes any effects of ! 40: .IR ungetc (3). ! 41: .PP ! 42: .I Ftell ! 43: returns the current value of the offset relative to the beginning ! 44: of the file associated with the named ! 45: .IR stream . ! 46: It is measured in bytes on UNIX; ! 47: on some other systems it is a magic cookie, ! 48: and the only foolproof way to obtain an ! 49: .I offset ! 50: for ! 51: .IR fseek . ! 52: .PP ! 53: .IR Rewind ( stream ) ! 54: is equivalent to ! 55: .IR fseek ( stream , ! 56: 0L, L_SET). ! 57: .SH "SEE ALSO" ! 58: lseek(2), ! 59: fopen(3) ! 60: .SH DIAGNOSTICS ! 61: .I Fseek ! 62: returns \-1 for improper seeks, otherwise zero.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.