|
MentOS
0.8.0
The Mentoring Operating System
|
String routines. More...
Go to the source code of this file.
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... | |
| char * | realpath (const char *path, char *buffer, size_t buflen) |
| Return the canonicalized absolute pathname. 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. |
| char* realpath | ( | const char * | path, |
| char * | buffer, | ||
| size_t | buflen | ||
| ) |
Return the canonicalized absolute pathname.
| path | the path we are canonicalizing. |
| buffer | where we will store the canonicalized path. |
| buflen | the size of the buffer. |