dirname()

return directory portion of path name 

Function


SYNOPSIS

#include <libgen.h>

char *dirname(char *path);


DESCRIPTION

The dirname() function takes the specified path name and returns a pointer to a string that is the path name of the parent directory of the file to which the input path refers. Trailing directory separator characters in the path are not counted as part of the path.

If the specified path does not contain any directory separator characters, dirname() returns a pointer to the string ".". If the specified path is null or is an empty string, then dirname() returns a pointer to the string ".".

The dirname() function may modify the specified string, and may return a pointer to static storage that may be overwritten by a subsequent call to dirname().


PARAMETERS

path 

Is the path name whose directory prefix is to be returned.


RETURN VALUES

The dirname() function returns a pointer to a string, as specified above.


CONFORMANCE

UNIX 98, with exceptions


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

The returned path is in NuTCRACKER Platform format, regardless of the format of the input path.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
basename()


PTC MKS Toolkit 10.4 Documentation Build 39.