ferror 中文man頁面
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)

















