feof 中文man頁(yè)面
NAME
clearerr, feof, ferror, fileno - 檢查以及重置流狀態(tài)
總覽 (SYNOPSIS)
#include <stdio.h>
void clearerr(FILE *stream);
int feof(FILE *stream);
int ferror(FILE *stream);
int fileno(FILE *stream);
描述 (DESCRIPTION)
函數(shù) clearerr 清除 stream 流 里面 的 文件末尾(end-of-file) 標(biāo)志 和 錯(cuò)誤 標(biāo)志,
函數(shù) feof 測(cè)試 stream 流 里面 的 文件末尾(end-of-file) 標(biāo)志, 如果 設(shè)置了 該 標(biāo)志, 函數(shù) 返回 非零. end-of-file 標(biāo)志 只能 用 clearerr 函數(shù) 清除.
函數(shù) ferror 測(cè)試 stream 流 里面的 錯(cuò)誤 標(biāo)志, 如果 設(shè)置了 該 標(biāo)志, 函數(shù) 返回 非零. 錯(cuò)誤 標(biāo)志 只能 用 clearerr 函數(shù) 復(fù)位.
函數(shù) fileno 檢查 stream 參數(shù), 然后 以 整數(shù) 返回 其 (文件)描述符.
相應(yīng)的 無(wú)鎖函數(shù)(non-locking) 參見(jiàn) unlocked_stdio(3).
錯(cuò)誤 (ERRORS)
這些 函數(shù) 不會(huì) 失敗, 也 不設(shè)置 外部變量 errno. (然而, 如果 fileno 檢測(cè)到 它的 參數(shù) 不是 有效的 流, 它 必須 返回 -1 并且 把 errno 設(shè)置為 EBADF.)
遵循 (CONFORMING TO)
函數(shù) clearerr, feof, 和 ferror 遵循 X3.159-1989 (``ANSI C'') 標(biāo)準(zhǔn).
另見(jiàn) (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)