spdir_of¶
Category: path
GitHub: cute_file_system.h
Returns the directory of a given file or directory. Returns a new string.
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.
Related Pages¶
spfname
spfname_no_ext
spext
spext_equ
sppop
sppopn
spcompact
spnorm
sptop_of