IXP_OPEN(3)

πŸ“¦ version 0-unstable-2022-04, in nixos 26.05, nixpkgs unstable

πŸ’– IXP_OPEN(3) πŸ’–

okay so this page is from the Library Functions Manual, and it's literally all about opening and creating files. bestie, grab your ixp.h and let's go πŸ¦‹

✨ NAME ✨

these are the main characters of this page, no cap:

  • ixp_open
  • ixp_create
  • IxpCFid
  • IxpOMode

🌸 SYNOPSIS 🌸

like, here's the whole cast in code form β€” don't touch the punctuation, she's fragile πŸ’…

#include <ixp.h>

IxpCFid *ixp_open(IxpClient *c, const char *path, uint8_t mode);

IxpCFid *ixp_create(IxpClient *c, const char *path, uint perm, uint8_t mode);

typedef struct IxpCFid IxpCFid;
struct IxpCFid {
        uint32_t        fid;
        IxpQid          qid;
        uint8_t         mode;
        uint            open;
        uint            iounit;
        uint32_t        offset;
        IxpClient*      client;

        /* Private members */
        ...
}

enum IxpOMode {
        P9_OREAD        = 0,    /* open for read */
        P9_OWRITE       = 1,    /* write */
        P9_ORDWR        = 2,    /* read and write */
        P9_OEXEC        = 3,    /* execute, == read but check execute permission */
        P9_OTRUNC       = 16,   /* or'ed in (except for exec), truncate file first */
        P9_OCEXEC       = 32,   /* or'ed in, close on exec */
        P9_ORCLOSE      = 64,   /* or'ed in, remove on close */
        P9_ODIRECT      = 128,  /* or'ed in, direct access */
        P9_ONONBLOCK    = 256,  /* or'ed in, non-blocking call */
        P9_OEXCL        = 0x1000,       /* or'ed in, exclusive use (create only) */
        P9_OLOCK        = 0x2000,       /* or'ed in, lock after opening */
        P9_OAPPEND      = 0x4000        /* or'ed in, append only */
}

the way this synopsis is giving β€œeverything you need in one screenshot” πŸ“Έ

πŸŽ€ PARAMETERS πŸŽ€

  • path β€” the path of the file to open or create. yes bestie, the address of the file.
  • perm β€” the permissions with which to create the new file. these will be ANDed with those of the parent directory by the server. important!!
  • mode β€” the file's open mode. that's the vibe of how you're opening it.

πŸ”₯ DESCRIPTION πŸ”₯

okay so ixp_open and ixp_create each open a file at path. mode must include OREAD, OWRITE, or ORDWR, and it may include any of the modes specified in IxpOMode(3). ixp_create, additionally, creates a file at path if it doesn't already exist. slay, that's the whole plot ✨

🫢 RETURN VALUE 🫢

a pointer on which to operate on the newly opened file. that's your cute lil handle for the freshly opened file, bestie β€” go do stuff with it πŸ’–

🌈 SEE ALSO 🌈

go read these next, iykyk:


mwah πŸ’‹ this was IXP_OPEN(3) from the libixp Manual, stamped 2012 Dec. bye bestie, go open some files responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from