mirror of
https://github.com/NixOS/nix
synced 2025-07-06 00:51:47 +02:00
Don't change nix::fs for now
This commit is contained in:
parent
02f0294be0
commit
37f4c71d1c
4 changed files with 9 additions and 3 deletions
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace nix {
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
namespace fs { using namespace std::filesystem; }
|
||||
|
||||
/**
|
||||
* Treat the string as possibly an absolute path, by inspecting the
|
||||
|
|
|
@ -126,6 +126,8 @@ std::optional<struct stat> maybeLstat(const Path & path);
|
|||
*/
|
||||
bool pathExists(const Path & path);
|
||||
|
||||
namespace fs {
|
||||
|
||||
/**
|
||||
* ```
|
||||
* symlink_exists(p) = std::filesystem::exists(std::filesystem::symlink_status(p))
|
||||
|
@ -139,6 +141,8 @@ inline bool symlink_exists(const std::filesystem::path & path) {
|
|||
return std::filesystem::exists(std::filesystem::symlink_status(path));
|
||||
}
|
||||
|
||||
} // namespace fs
|
||||
|
||||
/**
|
||||
* A version of pathExists that returns false on a permission error.
|
||||
* Useful for inferring default paths across directories that might not
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
|
||||
namespace nix {
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
namespace fs {
|
||||
using namespace std::filesystem;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue