GFS_PIO_OPEN(3)
π GFS_PIO_OPEN(3) β the Gfarm manual, bestie edition π
okay so we're diving into Gfarm's very own file-opening girlie, gfs_pio_open. yes she's a libc-flavored queen, yes she lives in section 3 of the manual, and yes she's about to open a file for you in the Gfarm file system. let's get into it π«Ά
β¨ NAME β¨
gfs_pio_open β open a file in the Gfarm file system
πΈ SYNOPSIS πΈ
#include <gfarm/gfarm.h>
gfarm_error_t gfs_pio_open(const char * gfarm_url, int flags,
GFS_File * gfp);
π¦ DESCRIPTION π¦
so gfs_pio_open() opens a file in the Gfarm file system β the one you point at with gfarm_url β and hands you back a GFS_File structure, dropped right at the address that gfp is pointing to. π
and what even is gfarm_url? it's either a plain old path name in the Gfarm file system, or a full Gfarm URL shaped like gfarm://metaserver:port/path/name. both are valid, she's flexible like that. β¨
now, flags. you build these by bitwise-inclusive-OR-ing the list below together. and listen β exactly one of the first three values should be specified. not two. not zero. one. the vibe check is strict on this. π
GFARM_FILE_RDONLYβ open for reading only πGFARM_FILE_WRONLYβ open for writing only βοΈGFARM_FILE_RDWRβ open for reading and writing, main character energy πGFARM_FILE_TRUNCβ if the file already exists and it's a regular file, it gets truncated to length0, but only if the open mode actually allows writingGFARM_FILE_APPENDβ the file is opened in append modeGFARM_FILE_UNBUFFEREDβ the file is accessed without buffering
π RETURN VALUES π
here's the whole roster of what she can hand back to you. no skipping, we're listing all of them because every single one matters: π
GFARM_ERR_NO_ERRORβ the function terminated successfully πGFARM_ERR_IS_A_DIRECTORYβgfarm_urlrefers to a directoryGFARM_ERR_IS_A_SYMBOLIC_LINKβgfarm_urlrefers to a symbolic linkGFARM_ERR_OPERATION_NOT_PERMITTEDβgfarm_urlrefers to not a regular fileGFARM_ERR_NO_SUCH_OBJECTβ a component used as a directory ingfarm_urldoes not existGFARM_ERR_NOT_A_DIRECTORYβ a component used as a directory ingfarm_urlis not, in fact, a directoryGFARM_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 authentication to the metadata server failsGFARM_ERR_NO_MEMORYβ insufficient memory was availableGFARM_ERR_INVALID_ARGUMENTβflagsis not validGFARM_ERR_GFARM_URL_HOST_IS_MISSINGβgfarm_urldoes not include a metadata serverGFARM_ERR_GFARM_URL_PORT_IS_MISSINGβgfarm_urldoes not include a port number of the metadata serverGFARM_ERR_UNKNOWN_HOSTβ the metadata server cannot be resolvedGFARM_ERR_TOO_MANY_OPEN_FILESβ the process opens too many filesGFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEMβ the system limit on the total number of open files has been reachedGFARM_ERR_NETWORK_IS_UNREACHABLEβ network is unreachableGFARM_ERR_OPERATION_TIMED_OUTβ connection timeout occursGFARM_ERR_PROTOCOLβ protocol error occursGFARM_ERR_BROKEN_PIPEβ connection to the metadata server is broken πGFARM_ERR_PROTOCOL_NOT_SUPPORTEDβ specified authentication protocol is not supportedGFARM_ERR_AUTHENTICATIONβ user authentication failed when connecting to the metadata server- Others β an error except the above occurred. the reason is shown by
gfarm_error_string(3)
π SEE ALSO π
go read these too, they're all in the family, iykyk:
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's from Gfarm, dated 8 Aug 2020. periodt. πΈβ¨
π¦ 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