版本2和4间的区别 (跳过第2版)
于2007-07-18 21:07:44修订的的版本2
大小: 1280
编辑: czk
备注:
于2008-02-23 15:37:07修订的的版本4
大小: 1248
编辑: localhost
备注: converted to 1.6 markup
删除的内容标记成这样。 加入的内容标记成这样。
行号 2: 行号 2:
[[Navigation(slides)]] <<Navigation(slides)>>
行号 24: 行号 24:



[[Navigation(siblings)]]

<<Navigation: 执行失败 ['AllContext' object has no attribute 'values'] (see also the log)>>

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.

void rewind(FILE *stream)
  • rewind(fp) is equivalent to fseek(fp, 0L, SEEK_SET); clearerr(fp).

int fgetpos(FILE *stream, fpos_t *ptr)
  • fgetpos records the current position in stream in *ptr, for subsequent use by fsetpos. The type fpos_t is suitable for recording such values. fgetpos returns non-zero on error.

int fsetpos(FILE *stream, const fpos_t *ptr)
  • fsetpos positions stream at the position recorded by fgetpos in *ptr. fsetpos returns non-zero on error.

TCPL/B.01.6_File_Positioning_Functions (2008-02-23 15:37:07由localhost编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.