End-of-file
In computing, end-of-file (commonly abbreviated EOF[1]) is a condition in a computer operating system where no more data can be read from a data source. The data source is usually called a file or stream. In general, the EOF is either determined when the reader returns null as seen in Java's BufferedReader,[2] or sometimes people will manually insert an EOF character of their choosing to signal when the file has ended.
In the C Standard Library, the character reading functions such as getchar return a value equal to the symbolic value (macro) EOF
to indicate that an end-of-file condition has occurred. The actual value of EOF
is system-dependent (but is commonly -1, such as in glibc[3]) and is unequal to any valid character code. Block-reading functions return the number of bytes read, and if this is fewer than asked for, then the end of file was reached or an error occurred (checking of errno
or dedicated function, such as ferror
is often required to determine which).
- ^ Wayne Pollock. "Shell Here Document Overview". hccfl.edu. Archived from the original on 2014-05-29. Retrieved 2014-05-28.
{{cite web}}
: Unknown parameter|deadurl=
ignored (|url-status=
suggested) (help) - ^ "BufferedReader". Oracle. Retrieved 28 February 2014.
- ^ https://www.gnu.org/software/libc/manual/html_mono/libc.html#EOF-and-Errors