home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / stdio / fseek.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  1.1 KB  |  49 lines

  1. @node fseek, stdio
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <stdio.h>
  6.  
  7. int fseek(FILE *file, long offset, int mode);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function moves the file pointer for @var{file} according to
  13. @var{mode}:
  14.  
  15. @table @code
  16.  
  17. @item SEEK_SET
  18.  
  19. The file pointer is moved to the offset specified.
  20.  
  21. @item SEEK_CUR
  22.  
  23. The file pointer is moved relative to its current position.
  24.  
  25. @item SEEK_END
  26.  
  27. The file pointer is moved to a position @var{offset} bytes from the end
  28. of the file.  The offset is usually nonpositive in this case. 
  29.  
  30. @end table
  31.  
  32. @emph{Warning!} The ANSI standard only allows values of zero for
  33. @var{offset} when @var{whence} is not @code{SEEK_SET} and the file has
  34. been opened as a text file.  Although this restriction is not enforced,
  35. beware that there is not a one-to-one correspondence between file
  36. characters and text characters under MS-DOS, so some @code{fseek}
  37. operations may not do exactly what you expect. 
  38.  
  39. @subheading Return Value
  40.  
  41. Zero if successful, nonzero if not. 
  42.  
  43. @subheading Example
  44.  
  45. @example
  46. fseek(stdin, 12, SEEK_CUR); /* skip 12 bytes */
  47. @end example
  48.  
  49.