Returns the last component of a path name.
#include <libgen.h> char *basename ( char *path);
(IN) Points to the buffer containing the directory path.
Returns a pointer to the last component in the path:
If the path consists of "/" or "\" characters, returns a pointer to the string: "/"
If the path is a NULL pointer or an empty string, returns a pointer to the string: "."
No errors have been defined for this function.
The basename function takes the path name pointed to by path and returns a pointer to the final component of the pathname, deleting any trailing "/" characters.
IMPORTANT:The basename function is not thread-safe.