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

libutil: Add callback-based FileSystemObjectSink::createDirectory

This commit is contained in:
Sergei Zimmerman 2025-11-20 01:27:18 +03:00
parent fa380e0991
commit 09755e696a
No known key found for this signature in database
3 changed files with 62 additions and 44 deletions

View file

@ -34,11 +34,12 @@ void copyRecursive(SourceAccessor & accessor, const CanonPath & from, FileSystem
}
case SourceAccessor::tDirectory: {
sink.createDirectory(to);
for (auto & [name, _] : accessor.readDirectory(from)) {
copyRecursive(accessor, from / name, sink, to / name);
break;
}
sink.createDirectory(to, [&](FileSystemObjectSink & dirSink, const CanonPath & relDirPath) {
for (auto & [name, _] : accessor.readDirectory(from)) {
copyRecursive(accessor, from / name, dirSink, relDirPath / name);
break;
}
});
break;
}