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:
parent
52ccaf7971
commit
ddea4c6deb
6 changed files with 6 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue