mirror of
https://github.com/NixOS/nix
synced 2025-07-05 20:41:47 +02: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;
|
||||
|
|
|
@ -117,8 +117,6 @@ bool pathAccessible(const Path & path);
|
|||
*/
|
||||
Path readLink(const Path & path);
|
||||
|
||||
bool isLink(const Path & path);
|
||||
|
||||
/**
|
||||
* Read the contents of a directory. The entries `.` and `..` are
|
||||
* removed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue