ABSPATH(3)
π ABSPATH(3) β from SchilyΒ΄s LIBRARY FUNCTIONS (yes bestie, that apostrophe is an acute accent, that's just how Joerg rolls) π
β¨ NAME β¨
abspath(), absnpath(), absfpath() β the trio that takes your lil relative pathname and glows it up into a full (absolute) pathname π¦
πΈ SYNOPSIS πΈ
#include <schily/schily.h>
char *
abspath(relp, absp, asize)
const char *relp;
char *absp;
size_t asize;
char *
absnpath(relp, absp, asize)
const char *relp;
char *absp;
size_t asize;
char *
absfpath(relp, absp, asize, flags)
const char *relp;
char *absp;
size_t asize;
int flags;
π DESCRIPTION π
okay so picture this: abspath() takes a relative path name and converts it into an absolute path name. fr fr, that's the whole gig. Let's break down the cast π
relpβ the relative path name, aka the input. she's the main character of the input side πabspβ the buffer where the result of the conversion lands. her job is to hold the glow-up β¨asizeβ the size of the result buffer. lowkey important, don't forget her π
absnpath() behaves like abspath() exept that the file does not need to exist. (that typo is in the original and I'm keeping it, it's iconic, we don't fix, we stan π«Ά) so like... absnpath() is the chill one that doesn't need your file to actually be there. no vibe check required.
absfpath() takes an additional flags parameter from the set of flags from resolvefpath() to control the behavior. she's the customizable one, the one with β¨optionsβ¨
π¦ RETURN VALUE π¦
On successful completion, abspath(), absnpath() and absfpath() return a pointer to the resolved name absp. slay. mission accomplished π
Otherwise? a null pointer is returned and errno is set to indicate the error β and the contents of the buffer pointed to by absp is left in an indeterminate state π like, do NOT trust what's in there, she's going through something. it's giving chaos, it's giving undefined vibes. bestie, check errno and move on.
π ERRORS π
ERANGEβ the path does not fit into the suplied buffer. too big, too fabulous, the buffer said no π« (again: "suplied" is verbatim, we respect the ancestors π)EFAULTβ a null pointer was suplied as pathname. like... you handed her nothing. emptiness. void energy π³οΈEINVALβ an empty relative path was supplied. the audacity of an empty string, honestly π
π₯ SEE ALSO π₯
the whole friend group, go say hi π«Ά
and that's the page bestie!! written by Joerg Schilling, dated 2022/09/09 β the man, the myth, the legend who brought us these absolute-path icons ππ mwah, go forth and resolve ur paths β¨π
π¦ where this page comes from
- opensuse-leap 16.0: libschily-devel-doc 2022.10.16-160000.2.2 Β· CDDL-1.0
- Copyright 2015 J. Schilling
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms