1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00

rm isLink

isLink util is removed in favour of std::filesystem::is_symlink
This commit is contained in:
siddhantCodes 2024-05-08 19:59:37 +05:30
parent 52ccaf7971
commit ddea4c6deb
6 changed files with 6 additions and 13 deletions

View file

@ -94,7 +94,7 @@ Path canonPath(PathView path, bool resolveSymlinks)
path,
[&followCount, &temp, maxFollow, resolveSymlinks]
(std::string & result, std::string_view & remaining) {
if (resolveSymlinks && isLink(result)) {
if (resolveSymlinks && std::filesystem::is_symlink(result)) {
if (++followCount >= maxFollow)
throw Error("infinite symlink recursion in path '%0%'", remaining);
remaining = (temp = concatStrings(readLink(result), remaining));
@ -222,12 +222,6 @@ Path readLink(const Path & path)
}
bool isLink(const Path & path)
{
return getFileType(path) == fs::file_type::symlink;
}
std::vector<fs::directory_entry> readDirectory(const Path & path)
{
std::vector<fs::directory_entry> entries;