Next: searchpath, Previous: File Directory, Up: File Directory
Remove the prefix and optionally a suffix of a string.
#include <suplib/file.h>char *base_name( char *string, char *suffix );
char *string
- the string to process
char *suffix
- an optional suffix to remove. Set it to
NULL
to do nothing
base_name
removes all but the last level in a path (the file name)
and, optionally, a suffix. The former is accomplished by returning a
pointer to the first character in the filename. The latter is accomplished
by writing an end of string character into the string.
It returns a pointer to the beginning of the filename.
Diab Jerius