1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-22 10:19:36 +01:00

symlink_exists: wrap exceptions into nix exception

(cherry picked from commit 779687854f)
This commit is contained in:
Jörg Thalheim 2025-04-02 21:22:43 +02:00 committed by Mergify
parent 06add7e551
commit f17f3a22c6
2 changed files with 13 additions and 4 deletions

View file

@ -134,6 +134,7 @@ bool pathExists(const Path & path);
namespace fs {
/**
* TODO: we may actually want to use pathExists instead of this function
* ```
* symlink_exists(p) = std::filesystem::exists(std::filesystem::symlink_status(p))
* ```
@ -142,9 +143,7 @@ namespace fs {
* std::filesystem::exists(p) = std::filesystem::exists(std::filesystem::status(p))
* ```
*/
inline bool symlink_exists(const std::filesystem::path & path) {
return std::filesystem::exists(std::filesystem::symlink_status(path));
}
bool symlink_exists(const std::filesystem::path & path);
} // namespace fs