|
libu8
|
These functions provide ways to manipulate file pathnames. More...
Functions | |
| U8_EXPORT u8_string | u8_getcwd (void) |
| Gets the current working directory. | |
| U8_EXPORT int | u8_setcwd (u8_string dirname) |
| Changes the current working directory. | |
| U8_EXPORT char * | u8_localpath (u8_string path) |
| Returns an absolute local pathname from a utf-8 pathname. | |
| U8_EXPORT u8_string | u8_mkpath (u8_string dir, u8_string name) |
| Makes a pathname by combining a directory and a name component. | |
| U8_EXPORT u8_string | u8_abspath (u8_string path, u8_string wd) |
| Returns an absolute pathname given a current directory. | |
| U8_EXPORT u8_string | u8_dirname (u8_string path) |
| Returns the directory component of a pathname. | |
| U8_EXPORT u8_string | u8_basename (u8_string path, u8_string suffix) |
| Returns the non-directory non-suffix component of a pathname. | |
| u8_string | u8_realpath (u8_string path, u8_string wd) |
| Returns an absolute pathname, resolving symbolic links. | |
These functions provide ways to manipulate file pathnames.
They provide both utility functions and translation from unix-style UTF-8 pathnames to the local file system encoding and conventions. They do not provide access (in general) to file metadata or content.
| U8_EXPORT u8_string u8_abspath | ( | u8_string | path, |
| u8_string | wd | ||
| ) |
Returns an absolute pathname given a current directory.
| path | a pathname |
| wd | a directory name |
| U8_EXPORT u8_string u8_basename | ( | u8_string | path, |
| u8_string | suffix | ||
| ) |
Returns the non-directory non-suffix component of a pathname.
Returns the non-directory non-suffix component of a pathname. If the suffix is provided, it is stripped from the end of the pathname.
| path | a utf-8 pathname |
| suffix | a utf-8string |
| U8_EXPORT u8_string u8_dirname | ( | u8_string | path | ) |
Returns the directory component of a pathname.
| path | a utf-8 pathname |
| U8_EXPORT u8_string u8_getcwd | ( | void | ) |
Gets the current working directory.
Converts its result from the local encoding to utf-8
| U8_EXPORT char* u8_localpath | ( | u8_string | path | ) |
Returns an absolute local pathname from a utf-8 pathname.
This handles interpretation of relative pathnames and ~ prefixes as well as encoding conversion.
| path | a utf8 string |
| U8_EXPORT u8_string u8_mkpath | ( | u8_string | dir, |
| u8_string | name | ||
| ) |
Makes a pathname by combining a directory and a name component.
| dir | a utf-8 directory name |
| name | a utf-8 filename |
| u8_string u8_realpath | ( | u8_string | path, |
| u8_string | wd | ||
| ) |
Returns an absolute pathname, resolving symbolic links.
| path | a pathname |
| wd | a directory name |
| U8_EXPORT int u8_setcwd | ( | u8_string | dirname | ) |
Changes the current working directory.
Converts its argument into the local encoding and calls chdir() to make it the default directory.
| dirname | the directory name in utf-8 |
1.7.4