Don't change nix::fs for now

This commit is contained in:
Eelco Dolstra 2024-11-12 21:10:01 +01:00
parent 02f0294be0
commit 37f4c71d1c
4 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -8,7 +8,9 @@
namespace nix {
namespace fs = std::filesystem;
namespace fs {
using namespace std::filesystem;
}
namespace {

View File

@ -77,7 +77,7 @@ struct CmdEval : MixJSON, InstallableValueCommand, MixReadOnlyOption
if (writeTo) {
stopProgressBar();
if (nix::symlink_exists(*writeTo))
if (fs::symlink_exists(*writeTo))
throw Error("path '%s' already exists", writeTo->string());
std::function<void(Value & v, const PosIdx pos, const fs::path & path)> recurse;