Skip to content

Commit

Permalink
Replace os::fileOrDirExists implementation with boost::filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jan 29, 2017
1 parent f710f00 commit 55b34e2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libs/os/file.h
Expand Up @@ -65,7 +65,14 @@ namespace os
/// \brief Returns true if the file or directory identified by \p path exists.
inline bool fileOrDirExists(const std::string& path)
{
return file_accessible(path.c_str(), FileAccess::Exists);
try
{
return boost::filesystem::exists(path);
}
catch (boost::filesystem::filesystem_error&)
{
return false;
}
}

// Returns the file size in bytes, or static_cast<uintmax_t>(-1)
Expand Down

0 comments on commit 55b34e2

Please sign in to comment.