Functions | |
| String | realPath (const String &path) |
| Convert path to the canonicalized absolute pathname by expanding all symbolic links and resolving references to /. | |
| String | dirname (const String &filename) |
| Take a string that contains a pathname, and return a string that is a pathname of the parent directory of that file. | |
| String | getCurrentWorkingDirectory () |
| Get the process's current working directory. | |
| String BLOCXX_NAMESPACE::FileSystem::Path::dirname | ( | const String & | filename | ) |
Take a string that contains a pathname, and return a string that is a pathname of the parent directory of that file.
Trailing '/' characters in the path are not counted as part of the path. If path does not contain a '/', then dirname() shall return the string ".". If path an empty string, dirname() shall return the string ".".
| filename | The file pathname |
Definition at line 683 of file PosixFileSystem.cpp.
References BLOCXX_FILENAME_SEPARATOR, BLOCXX_FILENAME_SEPARATOR_C, BLOCXX_NAMESPACE::String::lastIndexOf(), BLOCXX_NAMESPACE::String::length(), BLOCXX_NAMESPACE::String::npos, and BLOCXX_NAMESPACE::String::substring().
| String BLOCXX_NAMESPACE::FileSystem::Path::getCurrentWorkingDirectory | ( | ) |
Get the process's current working directory.
Calls to chdir() or fchdir() will modify this. Multi-threaded applications must exercise caution changing the current working directory.
| FileSystemException,: | ENOENT-The current working directory has been unlinked. |
Definition at line 714 of file PosixFileSystem.cpp.
References BLOCXX_THROW_ERRNO, and MAXPATHLEN.
Referenced by realPath().
| String BLOCXX_NAMESPACE::FileSystem::Path::realPath | ( | const String & | path | ) |
Convert path to the canonicalized absolute pathname by expanding all symbolic links and resolving references to /.
/, /../ and extra / characters. If path is relative, it will be interpreted as relative to the current working directory. This function is similar to the SuSv3 function, however it's easier to use and thread safe.
| path | The path to canonicalize. |
| FileSystemException | EACCESS, EIO, ELOOP, ENOENT, ENOTDIR |
Definition at line 537 of file PosixFileSystem.cpp.
References BLOCXX_ASSERT, BLOCXX_THROW, BLOCXX_THROW_ERRNO_MSG, BLOCXX_NAMESPACE::String::c_str(), BLOCXX_NAMESPACE::String::empty(), BLOCXX_NAMESPACE::String::erase(), getCurrentWorkingDirectory(), BLOCXX_NAMESPACE::String::lastIndexOf(), BLOCXX_NAMESPACE::String::length(), BLOCXX_NAMESPACE::String::npos, and BLOCXX_NAMESPACE::FileSystem::readSymbolicLink().
Referenced by BLOCXX_NAMESPACE::FileSystem::readSymbolicLink().
1.5.3