Skip to content

spdir_of

Category: path
GitHub: cute_file_system.h


Returns the directory of a given file or directory. Returns a new string.

#define spdir_of(s) cf_path_directory_of(s)
Parameters Description
s The path string.

Code Example

Example fetching a directory a file sits within.

const char filename = spfname("/data/collections/rare/big_gem.txt");
printf("%s\n", filename);
// Prints: /rare

Remarks

sp stands for "sting path". Call sfree on the return value when done.

spfname
spfname_no_ext
spext
spext_equ
sppop
sppopn
spcompact
spnorm
sptop_of