自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

rewind 中文man頁(yè)面

系統(tǒng)
函數(shù) fseek 設(shè)置 stream 流 的 文件位置 標(biāo)志. 新的 文件位置 (以 字節(jié) 為 單位) 根據(jù) whence 指定的 文件位置 加上 offset 獲得. 如果 whence 設(shè)置為 SEEK_SET, SEEK_CUR, 或 SEEK_END, 則 對(duì)應(yīng)的 文件位置 分別是 文件開(kāi)始, 當(dāng)前位置, 或 文件末尾. 成功 調(diào)用 fseek 后, 函數(shù) 清除 流 的 文件末尾 標(biāo)志(end-of-file), 同時(shí) 消除 ungetc(3) 函數(shù) 對(duì) 流 的 影響.

NAME

fgetpos, fseek, fsetpos, ftell, rewind - 重定位某個(gè)流  

總覽 (SYNOPSIS)

#include <stdio.h>

int fseek(FILE *stream, long offset, int whence);
long ftell(FILE *stream);
void rewind(FILE *stream);
int fgetpos(FILE *stream, fpos_t *pos);
int fsetpos(FILE *stream, fpos_t *pos);  

描述 (DESCRIPTION)

函數(shù) fseek 設(shè)置 stream 流 的 文件位置 標(biāo)志. 新的 文件位置 (以 字節(jié) 為 單位) 根據(jù) whence 指定的 文件位置 加上 offset 獲得. 如果 whence 設(shè)置為 SEEK_SET, SEEK_CUR, 或 SEEK_END, 則 對(duì)應(yīng)的 文件位置 分別是 文件開(kāi)始, 當(dāng)前位置, 或 文件末尾. 成功 調(diào)用 fseek 后, 函數(shù) 清除 流 的 文件末尾 標(biāo)志(end-of-file), 同時(shí) 消除 ungetc(3) 函數(shù) 對(duì) 流 的 影響.

ftell 函數(shù) 能夠 獲取 stream 流 的 當(dāng)前 文件位置.

rewind 函數(shù) 把 stream 流 的 文件位置 設(shè)置到 文件開(kāi)始處. 它 等效于:

(void)fseek(stream, 0L, SEEK_SET)

另外 它 還能 清除 流 的 錯(cuò)誤標(biāo)志 (見(jiàn) clearerr(3)).

fgetposfsetpos 函數(shù) 相當(dāng)于 ftellfseek (whence 設(shè)置 為 SEEK_SET) 的 另一種 寫法, 讀取 當(dāng)前 文件位置 并 保存在 pos 中, 或用 pos 指向的值 設(shè)置 當(dāng)前 文件位置. 在 某些 非UNIX系統(tǒng) 中, fpos_t 可以 是 一種 復(fù)雜的 (數(shù)據(jù))對(duì)象, 因而 這兩個(gè)函數(shù) 大概是 *** 可移植的 流定位函數(shù).

返回值 (RETURN VALUE)

rewind 函數(shù) 沒(méi)有 返回值. 如果 操作 成功, fgetpos, fseek, fsetpos 返回 0, 而 ftell 返回 當(dāng)前 偏移 (當(dāng)前 文件位置), 否則 返回 -1, 并 設(shè)置 全局變量 errno, 指出 錯(cuò)誤 類型.

錯(cuò)誤 (ERRORS)

EBADF
stream 流 不是 可重定位的 流 (non-seekable stream).
EINVAL
fseekwhence 參數(shù) 不是 SEEK_SET, SEEK_END, 或 SEEK_CUR.

fgetpos, fseek, fsetpos, 和 ftell 函數(shù) 也可能 失敗后, 把 errno 設(shè)置為 fflush(3), fstat(2), lseek(2), 和 malloc(3) 的 錯(cuò)誤 類型.  

遵循 (CONFORMING TO)

fgetpos, fsetpos, fseek, ftell, 和 rewind 函數(shù) 遵循 ANSI X3.159-1989 (``ANSI C'') 標(biāo)準(zhǔn).  

另見(jiàn) (SEE ALSO)

lseek(2), fseeko(3)  

#p#

NAME

fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream  

SYNOPSIS

#include <stdio.h>

int fseek(FILE *stream, long offset, int whence);
long ftell(FILE *stream);
void rewind(FILE *stream);
int fgetpos(FILE *stream, fpos_t *pos);
int fsetpos(FILE *stream, fpos_t *pos);  

DESCRIPTION

The fseek function sets the file position indicator for the stream pointed to by stream. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the fseek function clears the end-of-file indicator for the stream and undoes any effects of the ungetc(3) function on the same stream.

The ftell function obtains the current value of the file position indicator for the stream pointed to by stream.

The rewind function sets the file position indicator for the stream pointed to by stream to the beginning of the file. It is equivalent to:

(void)fseek(stream, 0L, SEEK_SET)

except that the error indicator for the stream is also cleared (see clearerr(3)).

The fgetpos and fsetpos functions are alternate interfaces equivalent to ftell and fseek (with whence set to SEEK_SET), setting and storing the current value of the file offset into or from the object referenced by pos. On some non-UNIX systems an fpos_t object may be a complex object and these routines may be the only way to portably reposition a text stream.  

RETURN VALUE

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 the global variable errno is set to indicate the error.  

ERRORS

EBADF
The stream specified is not a seekable stream.
EINVAL
The whence argument to fseek was not SEEK_SET, SEEK_END, or SEEK_CUR.

The function fgetpos, fseek, fsetpos, and ftell may also fail and set errno for any of the errors specified for the routines fflush(3), fstat(2), lseek(2), and malloc(3).  

CONFORMING TO

The fgetpos, fsetpos, fseek, ftell, and rewind functions conform to ANSI X3.159-1989 (``ANSI C'').  

SEE ALSO

lseek(2), fseeko(3)

責(zé)任編輯:韓亞珊 來(lái)源: CMPP.net
相關(guān)推薦

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-15 15:02:31

usleep中文man

2011-09-23 13:59:40

find中文man

2011-08-12 09:17:57

deallocvt中文man

2011-08-25 17:24:54

puts中文man

2011-07-15 16:58:36

ac中文man

2011-08-11 18:32:21

cp中文man

2011-08-23 11:34:26

ipcs中文man

2011-08-25 10:16:02

lmhosts中文man

2011-08-24 15:29:06

grant中文man

2011-08-25 17:32:40

setbuffer中文man

2011-08-25 16:50:08

getc中文man

2011-08-25 16:52:54

getchar中文man

2011-08-25 17:03:51

pclose中文man

2011-08-25 16:22:29

fputc中文man

2011-08-25 16:28:50

fread中文man

2011-08-25 16:10:52

fgets中文man
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)