FEOF(3P)

πŸ’– FEOF(3P) β€” bestie, it's the POSIX Programmer's Manual πŸ’–

okay so real quick before we dive in β€” this page lives in the POSIX Programmer's Manual, and there's a little disclaimer energy up top that you absolutely need to know:

The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

like, don't come for me if Linux does its own thing, go read the Linux page, okay? 🫢


🌸 NAME 🌸

feof β€” test end-of-file indicator on a stream

like, "hey is this stream done?" detector. that's the whole job. πŸ’…


✨ SYNOPSIS ✨

#include <stdio.h>

int feof(FILE *stream);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so first thing first, the tea: the functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional β€” so if you spot one, it's not a feature, it's an accident 😭. This volume of POSIX.1‐2017 defers to the ISO C standard, periodt.

Now the actual vibe:

The feof() function shall test the end-of-file indicator for the stream pointed to by stream.

and here's the lowkey iconic part β€” the feof() function shall not change the setting of errno if stream is valid. no cap. it just peeks. it does not touch your errno. respectful king behavior πŸ‘‘.


⭐ RETURN VALUE ⭐

The feof() function shall return non-zero if and only if the end-of-file indicator is set for stream.

if and only if. fr fr. not "sometimes", not "vibes-based" β€” it's a strict biconditional, bestie. πŸŽ€


πŸ’€ ERRORS πŸ’€

No errors are defined.

and just so you know:

The following sections are informative.

(translation: the next few sections are ✨ lore ✨, not rules.)


🌈 EXAMPLES 🌈

None.

sad. empty. not a single example to snack on πŸ™ˆ


πŸ“ APPLICATION USAGE πŸ“

None.

also empty. the void. she's giving minimalist 🧚


πŸ’œ RATIONALE πŸ’œ

None.

they really said "no thoughts, head empty" for this one 😭


πŸ”₯ FUTURE DIRECTIONS πŸ”₯

None.

nothing coming down the pipeline. she's stable. she's settled. main character energy that doesn't need a sequel πŸ’…


🫢 SEE ALSO 🫢

  • clearerr()
  • ferror()
  • fopen()

and also β€” the Base Definitions volume of POSIX.1‐2017, <stdio.h> ✨


okay bestie, legal moment, don't skip it, it's important:

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie πŸ’– go forth and check your EOF indicators responsibly

IEEE/The Open Group, 2017 β€” FEOF(3P), signing off πŸŽ€βœ¨

πŸ“¦ where this page comes from