yat
0.14.5pre
|
Checking file/directory existence and access permissions. More...
#include <yat/utility/FileUtil.h>
Public Member Functions | |
FileUtil (const std::string &path) | |
Constructor, copies path only. | |
FileUtil (const FileUtil &) | |
Copies the path. More... | |
int | permissions (const std::string &bits) const |
Check file/directory permissions. More... | |
bool | exists (void) const |
Check whether file exists. More... | |
bool | lexists (void) const |
const std::string & | path (void) const |
Get path associated with the object. | |
FileUtil & | operator= (const FileUtil &) |
assignment operator More... | |
Checking file/directory existence and access permissions.
FileUtil is a wrapper to access(2) and stat(2).
theplu::yat::utility::FileUtil::FileUtil | ( | const FileUtil & | ) |
Copies the path.
bool theplu::yat::utility::FileUtil::exists | ( | void | ) | const |
Check whether file exists.
The check for the file is done when calling this function.
IO_error | if underlying stat(2) call fails in other ways than that file does not exist. |
bool theplu::yat::utility::FileUtil::lexists | ( | void | ) | const |
Same as exists(void) but uses lstat rather than stat. That implies that the function will return true also if path is a broken link.
assignment operator
int theplu::yat::utility::FileUtil::permissions | ( | const std::string & | bits | ) | const |
Check file/directory permissions.
Check if access permissions match mode. mode must be given as r, w, x, d, or combinations of these letters. The check is performed at call time.