zoukankan      html  css  js  c++  java
  • C Standard Library: File Positioning Functions

    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 nonzero
    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.

  • 相关阅读:
    oracle 大文本由clob来存
    merge into 语法缺陷
    基本元素的增加 jquery
    报表 jquery
    购物车的高级实现 逻辑结构清晰
    购物车的实现 js
    定时器的制作与清除
    div的大小设置
    二级菜单联动(自定义框架)
    编写数组删除模板
  • 原文地址:https://www.cnblogs.com/freewater/p/2972250.html
Copyright © 2011-2022 走看看