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

replace all instances of std::filesystem::directory_iterator with DirectoryIterator

This commit is contained in:
Jörg Thalheim 2025-05-01 09:54:14 +02:00
parent 7ccc0d591f
commit 1c4496f4e5
16 changed files with 55 additions and 64 deletions

View file

@ -18,12 +18,12 @@ struct State
/* For each activated package, create symlinks */
static void createLinks(State & state, const Path & srcDir, const Path & dstDir, int priority)
{
std::filesystem::directory_iterator srcFiles;
DirectoryIterator srcFiles;
try {
srcFiles = std::filesystem::directory_iterator{srcDir};
} catch (std::filesystem::filesystem_error & e) {
if (e.code() == std::errc::not_a_directory) {
srcFiles = DirectoryIterator{srcDir};
} catch (SysError & e) {
if (e.errNo == ENOTDIR) {
warn("not including '%s' in the user environment because it's not a directory", srcDir);
return;
}