gd_dirfilename(3)
β¨ gd_dirfilename β bestie edition β¨
okay so this is a page from the GETDATA manual, and today we're learning about gd_dirfilename(3) β the little function that tells you what your Dirfile is actually called π
πΈ NAME πΈ
gd_dirfilename β retrieve the name of a Dirfile π
π¦ SYNOPSIS π¦
#include <getdata.h>
const char *gd_dirfilename(DIRFILE *dirfile);
π DESCRIPTION π
so the way that gd_dirfilename() works is: it goes and queries a dirfile(5) database β the one you point at with dirfile β and it hands you back its name. and like, the name of a dirfile isn't just a cute little nickname, bestie, it's an absolute pathname that refers to the dirfile base directory. the whole path. no cap. π₯
and the dirfile argument? it has to point to a valid DIRFILE object, one that you already made by calling gd_open(3). no skipping steps, you can't just manifest a DIRFILE out of thin air π
β RETURN VALUE β
when it works? iconic. it returns a pointer to a constant string containing the pathname of the dirfile. slay. π
when it doesn't work? gd_dirfilename() returns NULL, and it stores a negative-valued error code inside the DIRFILE object, which you can go get later with a subsequent call to gd_error(3). the possible error codes are:
GD_E_BAD_DIRFILEβ the supplied dirfile was invalid. that's it. that's the one. π
and if you want a whole descriptive error string for whatever went wrong, just call gd_error_string(3) and it'll spill the tea for you π«Ά
π HISTORY π
- the function
dirfilename()first appeared in GetData-0.3.0. baby's first era β¨ - in GetData-0.7.0, this function got renamed to
gd_dirfilename(). glow-up, honestly. - in GetData-0.10.0, the error return from this function changed from
-1to a negative-valued error code. not me checking the receipts π
π SEE ALSO π
gd_open(3), path_resolution(7)
and that's the whole vibe, bestie π§π this was Version 0.10.0, dated 25 December 2016 β merry everything, go forth and know your dirfile's name fr fr π
π¦ where this page comes from
- debian bookworm: libgetdata-doc 0.11.0-6
- debian trixie: libgetdata-doc 0.11.0-15
- fedora 43: getdata-devel 0.11.0-13.fc43 Β· GPL-2.0-or-later
- fedora 43: getdata-devel 0.11.0-13.fc43 Β· GPL-2.0-or-later
- fedora 44: getdata-devel 0.11.0-14.fc44 Β· GPL-2.0-or-later
- fedora 44: getdata-devel 0.11.0-14.fc44 Β· GPL-2.0-or-later
- nixos 26.05: getdata 0.11.0
- nixpkgs unstable: getdata 0.11.0
- ubuntu jammy: libgetdata-doc 0.11.0-3ubuntu1
- ubuntu noble: libgetdata-doc 0.11.0-13
- ubuntu questing: libgetdata-doc 0.11.0-15
- ubuntu resolute: libgetdata-doc 0.11.0-17build1
- ubuntu stonking: libgetdata-doc 0.11.0-17build2
- Copyright (C) 2016 D. V. Wiebe
- Copyright (C) 2008, 2010, 2012, 2016 D.V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms