open_rw(3)
open_rw πβ¨
okay bestie, so this one lives in the Library Functions Manual (section 3, the "we do syscalls but cute" section) and it's literally called open_rw β the rw stands for read and write, because why choose π
β¨ NAME β¨
open_rw β open a file for reading and writing π«Ά
πΈ SYNTAX πΈ
#include <libowfat/open.h>
int open_rw(const char *filename);
π DESCRIPTION π
so open_rw opens the file filename for reading AND writing use, and hands you back the file handle. two moods, one function, we love a multitasker π
if the file doesn't exist yet? no worries bestie, it gets created for you with mode 0644 β¨
and if something goes wrong β opening it, creating it, any of it β open_rw returns -1 and sets errno accordingly, so you can go check what the drama was π
lowkey important:-1means something went sideways, anderrnois where the gossip lives. always peek aterrno, fr fr.
π SEE ALSO π
the whole friend group, go say hi:
open(2)open_append(3)open_excl(3)open_read(3)open_trunc(3)open_write(3)openreadclose(3)readclose(3)readclose_append(3)
and that's the whole page, no cap π go open some files, you got this, mwah π
signing off from the Library Functions Manual, page open_rw(3) β that's the source and the name, bestie, that's the whole footer ππ¦
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms