MentOS
0.8.0
The Mentoring Operating System
|
String routines. More...
Functions | |
int | dirname (const char *path, char *buffer, size_t buflen) |
Extracts the parent directory of the given path and saves it inside the given buffer, e.g., from "/home/user/test.txt" it extracts "/home/user". If the path does not contain a '/', it will return ".". More... | |
const char * | basename (const char *path) |
Extract the component after the final '/'. More... | |
String routines.
const char* basename | ( | const char * | path | ) |
Extract the component after the final '/'.
path | the path from which we extract the final component. |
int dirname | ( | const char * | path, |
char * | buffer, | ||
size_t | buflen | ||
) |
Extracts the parent directory of the given path and saves it inside the given buffer, e.g., from "/home/user/test.txt" it extracts "/home/user". If the path does not contain a '/', it will return ".".
path | the path we are parsing. |
buffer | the buffer where we save the directory name. |
buflen | the length of the buffer. |