Returns the parent component of a path name.
#include <libgen.h> char *dirname ( char *path);
(IN) Points to the buffer containing the path name.
Returns a pointer to the parent component in the path:
If the path is a "/" or "\\" string, 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 dirname function takes a pointer to a character string that contains a pathname, and returns a pointer to a string that is a path name of the parent directory of that file.
IMPORTANT:The dirname function is not thread-safe.