ABSPATH(3)
π ABSPATH(3) Β· SchilyΒ΄s LIBRARY FUNCTIONS π
π NAME π
okay bestie, so abspath(), absnpath(), and absfpath() are the trio that expands a relative pathname to a full (absolute) pathname β¨. They take your little relative-path gremlin and turn it into the full absolute-path main character. π
π¦ 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 β¨
So abspath() takes a relative path name and converts it into an absolute path name π«. Hereβs the cast:
relpis the relative path name used as the input.abspis the buffer used for the result of the conversion.asizeis the size of the result buffer.
absnpath() behaves like abspath() except that the file does not need to exist π«Ά. Itβs giving βpath math doesnβt need a vibe check from the filesystem,β iykyk.
absfpath() takes an additional flags parameter from the set of flags from resolvefpath() to control the behavior π₯. Very βextra parameter, extra power,β no cap.
π RETURN VALUE π
On successful completion, abspath(), absnpath(), and absfpath() return a pointer to the resolved name absp π. Slay.
Otherwise, a null pointer is returned and errno is set to indicate the error π.
β οΈ Important, bestie: when that happens, the contents of the buffer pointed to by absp is left in an indeterminate state. Like, do not trust it, do not read it like itβs cute β it is not giving stable data. π
π¨ ERRORS π¨
ERANGEβ The path does not fit into the supplied buffer. π¬EFAULTβ A null pointer was supplied as pathname. πEINVALβ An empty relative path was supplied. π
π SEE ALSO π
resolvepath(3), resolvenpath(3), resolvefpath(3) π¦
π cute little sign-off: Joerg Schilling Β· 2022/09/09 Β· ABSPATH(3) π
π¦ 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