mirror of
https://github.com/NixOS/nix
synced 2024-09-19 23:03:53 -04:00
inline usage of nix::getFileType
and remove it
This commit is contained in:
parent
4537663740
commit
d3b7367c80
|
@ -225,7 +225,7 @@ void LocalStore::findRoots(const Path & path, std::filesystem::file_type type, R
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (type == std::filesystem::file_type::unknown)
|
if (type == std::filesystem::file_type::unknown)
|
||||||
type = getFileType(path);
|
type = std::filesystem::symlink_status(path).type();
|
||||||
|
|
||||||
if (type == std::filesystem::file_type::directory) {
|
if (type == std::filesystem::file_type::directory) {
|
||||||
for (auto & i : readDirectory(path))
|
for (auto & i : readDirectory(path))
|
||||||
|
|
|
@ -236,12 +236,6 @@ std::vector<fs::directory_entry> readDirectory(const Path & path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fs::file_type getFileType(const Path & path)
|
|
||||||
{
|
|
||||||
return fs::symlink_status(path).type();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string readFile(const Path & path)
|
std::string readFile(const Path & path)
|
||||||
{
|
{
|
||||||
AutoCloseFD fd = toDescriptor(open(path.c_str(), O_RDONLY
|
AutoCloseFD fd = toDescriptor(open(path.c_str(), O_RDONLY
|
||||||
|
|
|
@ -128,8 +128,6 @@ Descriptor openDirectory(const std::filesystem::path & path);
|
||||||
*/
|
*/
|
||||||
std::vector<std::filesystem::directory_entry> readDirectory(const Path & path);
|
std::vector<std::filesystem::directory_entry> readDirectory(const Path & path);
|
||||||
|
|
||||||
std::filesystem::file_type getFileType(const Path & path);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the contents of a file into a string.
|
* Read the contents of a file into a string.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue