Skip to content

spfname

Category: path
GitHub: cute_file_system.h


Returns the filename portion of a path. Returns a new string.

#define spfname(s) cf_path_get_filename(s)
Parameters Description
s The path string.

Code Example

Example fetching a filename from a path.

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

Remarks

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

spnorm
spfname_no_ext
spext
spext_equ
sppop
sppopn
spcompact
spdir_of
sptop_of