FILEOPEN(3)

πŸ“¦
version 2022.10.16 Β· 2 versions
, in opensuse-leap 16.0

πŸ’– FILEOPEN(3) πŸ’–

okay so bestie, you're in SchilyΒ΄s LIBRARY FUNCTIONS territory now, and this page is all about fileopen() β€” it opens or creates files, and it's lowkey iconic for it. πŸ’…


πŸ’– NAME πŸ’–

  • fileopen() β€” opens or creates files ✨

✨ SYNOPSIS ✨

FILE *fileopen(filename,modes)
char *filename;
char *modes;

πŸŽ€ DESCRIPTION πŸŽ€

okay so fileopen() opens filename. The mode is specified by the characters from the following set:

🧚 the mode characters, bestie 🧚

  • a β€” seek to end-of-file after opening
  • c β€” create file if necessary
  • r β€” allow read access
  • t β€” truncate file after opening if it already exists
  • u β€” unbuffered all read/writes directly to system
  • w β€” allow write access

πŸ¦‹ RETURNS πŸ¦‹

NULL means open failed, periodt. Any other value should be used in other I/O calls and is of the type FILE β€” that's the whole vibe check right there. 🫢

🌸 NOTES 🌸

The file is opened with rw rw access. If there is not enough room to allocate a buffer, the file is opened in an unbuffered mode. There is a limit to the number of open files β€” so like, don't go feral opening everything, okay? 😭

bestie, keep those facts close: NULL = failed open, and the file-open limit is real. no cap. πŸ’€

with love and FILEOPEN(3) energy, Joerg Schilling Β· 2022/09/09 πŸ’– (that's the source/version and date sign-off, bestie 🫢)

πŸ“¦ where this page comes from