FDUP(3)

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

✨ FDUP(3) β€” NAME ✨

fdup() β€” returns new file identical to the given file. that’s the whole vibe, bestie. πŸ’…

🌸 SYNOPSIS 🌸

okay so here’s the exact shape of it:

FILE fdup(f)
FILE *f;

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so fdup() creates a new file stream that accesses the same file as f. the new file has the same read/write/buffered attributes as the old file β€” literally matching energy, no cap. and yes, fdup() can be used to simultaneously read from two different positions in a file. iconic behavior. ✨

πŸŽ€ RETURNS πŸŽ€

  • if it’s successful, it returns the duplicate file. slay. πŸ’–
  • if it could not create the new stream, it returns NULL. 😭

πŸ’œ NOTES πŸ’œ

⚠️ bestie, use this call carefully on buffered files that are open for writing. changes made on one stream might be superseded by changes made on the other. so like… don’t let the streams fight, okay? πŸ™ˆ

that’s the page! Joerg Schilling wrote it, it’s from SchilyΒ΄s LIBRARY FUNCTIONS, dated 2022/09/09, and the manual name is FDUP(3). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from