#include <yat/utility/FileUtil.h>
Public Member Functions | |
FileUtil (const std::string &path) | |
Constructor, copies path only. | |
int | permissions (const std::string &bits) const |
Check file/directory permissions. | |
bool | exists (void) const |
Check whether file exists. | |
bool | lexists (void) const |
const std::string & | path (void) const |
Get path associated with the object. |
FileUtil is a wrapper to access(2) and stat(2).
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.
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.