GFS_PIO_CREATE(3)
β¨ GFS_PIO_CREATE β¨
okay bestie, welcome to the Gfarm girlies' corner of the man pages π
today we're talking about gfs_pio_create, and yes she's from the Gfarm manual, section 3, and yes she EATS. let's get into it π«Ά
πΈ NAME πΈ
gfs_pio_create β bestie makes a brand new file in the Gfarm file system. new file, who dis π
π¦ SYNOPSIS π¦
#include <gfarm/gfarm.h>
gfarm_error_t gfs_pio_create(const char * gfarm_url, int flags,
gfarm_mode_t mode, GFS_File * gfp);
β¨ DESCRIPTION β¨
so gfs_pio_create() literally creates a new file in the Gfarm file system. the name is the string that gfarm_url points to, and the access mode is mode, and she hands you back a GFS_File structure at the address gfp points to. iconic behavior tbh.
mode is the file permissions the file gets created with β and ngl it gets modified by the process's umask, so don't come crying if your bits aren't what you expected, that's just how the umask works π
now, the flags argument? same meaning as the second argument of gfs_pio_open(), including the part where you must specify exactly one of GFARM_FILE_RDONLY, GFARM_FILE_WRONLY, and GFARM_FILE_RDWR. exactly one, bestie. not zero, not two. we don't do that here π«Ά
on top of that, you can also pass GFARM_FILE_EXCLUSIVE. with that flag, gfs_pio_create() will fail if the file already exists. no overwriting, no drama, she said no π
β οΈ and listen, important:GFARM_FILE_TRUNCmust be explicitly specified in theflagsargument if you actually want it. she does NOT do it for you. not me assuming it would π
π RETURN VALUES π
here's the full tea on what she can hand back to you, no skips, no summaries, we're doing all of them π
GFARM_ERR_NO_ERRORβ the function terminated successfully. slay! she did it! πGFARM_ERR_IS_A_DIRECTORYβgfarm_urlrefers to a directory. babe that's a folder, not a file πGFARM_ERR_IS_A_SYMBOLIC_LINKβgfarm_urlrefers to a symbolic link.GFARM_ERR_OPERATION_NOT_PERMITTEDβgfarm_urlrefers to not a regular file.GFARM_ERR_NOT_A_DIRECTORYβ a component used as a directory ingfarm_urlis not, in fact, a directory. plot twist πGFARM_ERR_PERMISSION_DENIEDβ the requested access to the file is not allowed, or one of the directories ingfarm_urldidn't allow search (execute) permission, or the file didn't exist yet and write access to the parent directory is not allowed. Or, the authentication to the metadata server fails. yes that's a lot of ors, she's a multitasker πGFARM_ERR_NO_MEMORYβ insufficient memory was available. she's running on fumes bestie πGFARM_ERR_INVALID_ARGUMENTβflagsis not valid. girl. what did you pass. πGFARM_ERR_GFARM_URL_HOST_IS_MISSINGβgfarm_urldoes not include a metadata server.GFARM_ERR_GFARM_URL_PORT_IS_MISSINGβgfarm_urldoes not include a port number of the metadata server.GFARM_ERR_UNKNOWN_HOSTβ the metadata server cannot be resolved. she's lost in the sauce π§GFARM_ERR_TOO_MANY_OPEN_FILESβ the process opens too many files. bestie, close some of them, fr fr.GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEMβ the system limit on the total number of open files has been reached. that one's not even your fault, the whole system said no π₯GFARM_ERR_NETWORK_IS_UNREACHABLEβ network is unrechable.GFARM_ERR_OPERATION_TIMED_OUTβ connetion timeout occurs.GFARM_ERR_PROTOCOLβ protocol error occurs.GFARM_ERR_BROKEN_PIPEβ connection to the metadata server is broken. πGFARM_ERR_PROTOCOL_NOT_SUPPORTEDβ specified authentication protocol is not supported.GFARM_ERR_AUTHENTICATIONβ user authentication failed when connecting to the metadata server. she did not recognize you πGFARM_ERR_ALREADY_EXISTSβgfarm_urlalready exists andGFARM_FILE_EXCLUSIVEwas used. told you, exclusive means exclusive π- Others β an error except the above occurred. the reason is shown by
gfarm_error_string(3). when in doubt, go ask her π«Ά
π SEE ALSO π
the whole girl squad, all linked, all iconic:
gfs_pio_close(3), gfs_pio_create(3), gfs_pio_eof(3), gfs_pio_error(3), gfs_pio_flush(3), gfs_pio_getc(3), gfs_pio_getline(3), gfs_pio_open(3), gfs_pio_putc(3), gfs_pio_putline(3), gfs_pio_puts(3), gfs_pio_read(3), gfs_pio_seek(3), gfs_pio_ungetc(3), gfs_pio_write(3)
and that's the whole page bestie!! β¨π
this one came straight from the Gfarm crew, dated 3 Sep 2015 β yeah she's a classic, an OG, and she still serves π π½ mwah, go create some files responsibly, ily, bye π¦πΈ
π¦ where this page comes from
- debian bookworm: libgfarm-dev 2.7.20+dfsg-1+b2 Β· BSD-like
- debian trixie: libgfarm-dev 2.7.20+dfsg-1.2+b1 Β· BSD-like
- ubuntu jammy: libgfarm-dev 2.7.17+dfsg-1build2 Β· BSD-like
- ubuntu noble: libgfarm-dev 2.7.20+dfsg-1.1ubuntu1 Β· BSD-like
- ubuntu questing: libgfarm-dev 2.7.20+dfsg-1.2
- ubuntu resolute: libgfarm-dev 2.7.20+dfsg-1.3 Β· BSD-like
- ubuntu stonking: libgfarm-dev 2.7.20+dfsg-1.3build1 Β· BSD-like
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms