Path name parts. More...
#include <sys/types.h>
Go to the source code of this file.
Functions | |
char * | basename (CONST char *) |
Return the last component from a given pathname. | |
char * | dirname (CONST char *) |
Extract the directory part of a given pathname. |
Path name parts.
* * $Log$ * Revision 1.1 2006/08/01 07:42:56 haraldkipp * New functions extract last component and parent directory from pathnames. * * *
Definition in file libgen.h.
char* basename | ( | CONST char * | path | ) |
Return the last component from a given pathname.
Trailing slashes are removed.
path | Pointer to the pathname. |
Definition at line 71 of file basename.c.
References CONST, ENAMETOOLONG, errno, malloc(), MAXPATHLEN, strcpy(), and strlen().
char* dirname | ( | CONST char * | path | ) |
Extract the directory part of a given pathname.
This is the converse of basename().
path | Pointer to the pathname. |
Definition at line 70 of file dirname.c.
References CONST, ENAMETOOLONG, errno, malloc(), MAXPATHLEN, strcpy(), strlen(), and strncpy().