ferror 中文man页面

系统
函数 clearerr 清除 stream 流 里面 的 文件末尾(end-of-file) 标志 和 错误 标志,

NAME

clearerr, feof, ferror, fileno - 检查以及重置流状态  

总览 (SYNOPSIS)

#include <stdio.h>

void clearerr(FILE *stream);
int feof(FILE *stream);
int ferror(FILE *stream);
int fileno(FILE *stream);  

描述 (DESCRIPTION)

函数 clearerr 清除 stream 流 里面 的 文件末尾(end-of-file) 标志 和 错误 标志,

函数 feof 测试 stream 流 里面 的 文件末尾(end-of-file) 标志, 如果 设置了 该 标志, 函数 返回 非零. end-of-file 标志 只能 用 clearerr 函数 清除.

函数 ferror 测试 stream 流 里面的 错误 标志, 如果 设置了 该 标志, 函数 返回 非零. 错误 标志 只能 用 clearerr 函数 复位.

函数 fileno 检查 stream 参数, 然后 以 整数 返回 其 (文件)描述符.

相应的 无锁函数(non-locking) 参见 unlocked_stdio(3).  

错误 (ERRORS)

这些 函数 不会 失败, 也 不设置 外部变量 errno. (然而, 如果 fileno 检测到 它的 参数 不是 有效的 流, 它 必须 返回 -1 并且 把 errno 设置为 EBADF.)  

遵循 (CONFORMING TO)

函数 clearerr, feof, 和 ferror 遵循 X3.159-1989 (``ANSI C'') 标准.  

另见 (SEE ALSO)

open(2), unlocked_stdio(3), stdio(3)  

#p#

NAME

clearerr, feof, ferror, fileno - check and reset stream status  

SYNOPSIS

#include <stdio.h>

void clearerr(FILE *stream);
int feof(FILE *stream);
int ferror(FILE *stream);
int fileno(FILE *stream);  

DESCRIPTION

The function clearerr clears the end-of-file and error indicators for the stream pointed to by stream.

The function feof tests the end-of-file indicator for the stream pointed to by stream, returning non-zero if it is set. The end-of-file indicator can only be cleared by the function clearerr.

The function ferror tests the error indicator for the stream pointed to by stream, returning non-zero if it is set. The error indicator can only be reset by the clearerr function.

The function fileno examines the argument stream and returns its integer descriptor.

For non-locking counterparts, see unlocked_stdio(3).  

ERRORS

These functions should not fail and do not set the external variable errno. (However, in case fileno detects that its argument is not a valid stream, it must return -1 and set errno to EBADF.)  

CONFORMING TO

The functions clearerr, feof, and ferror conform to X3.159-1989 (``ANSI C'').  

SEE ALSO

open(2), unlocked_stdio(3), stdio(3)

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-25 15:47:06

fopen中文man

2011-08-25 15:37:03

fclose中文man

2011-08-25 15:24:31

execlp中文man

2011-08-25 15:28:49

execv中文man

2011-08-25 15:31:04

execvp中文man

2011-08-25 15:33:18

exit中文man

2011-08-25 16:08:55

fsetpos中文man

2011-08-25 16:16:21

fopen中文man

2011-08-25 16:44:46

ftrylockfil中文man

2011-08-25 16:19:23

fprintf中文man

2011-08-25 16:25:30

fputs中文man

2011-08-25 16:00:56

fflush中文man

2011-08-25 16:06:20

fgetc中文man

2011-08-25 16:31:38

fseek中文man

2011-08-25 16:39:41

fsetpos中文man

2011-08-25 16:42:37

ftell中文man
点赞
收藏

51CTO技术栈公众号