get_filename (3) - Linux Man Pages
get_filename: Returns a pointer to the filename portion of a path. Allegro game programming library.
NAMEget_filename - Returns a pointer to the filename portion of a path. Allegro game programming library.
DESCRIPTIONFinds out the filename portion of a completely specified file path. Both `\' and `/' are recognized as directory separators under DOS and Windows. However, only `/' is recognized as directory separator under other platforms. Example:
get_executable_name(name, sizeof(name)); allegro_message("Running `%s'\n", get_filename(name));Note that Allegro won't perform any IO operations during the verification. This means that if you have `/a/path/like/this/', which doesn't have a filename, the function will return a pointer to the trailing null character. However, if you have `/a/path/like/this', Allegro will return a pointer to `this', even if it is a valid directory.