diff options
Diffstat (limited to 'src/File.cc')
| -rw-r--r-- | src/File.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/File.cc b/src/File.cc index 3ee6c47a..14189ef0 100644 --- a/src/File.cc +++ b/src/File.cc @@ -79,6 +79,16 @@ bool File::exists() return fillStat(fstat) == 0; } +bool File::exists(std::string &err) +{ + a2_struct_stat fstat; + if (fillStat(fstat) != 0) { + err = fmt("Could not get file status: %s", strerror(errno)); + return false; + } + return true; +} + bool File::isFile() { a2_struct_stat fstat; |
