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:
parent
fa380e0991
commit
09755e696a
3 changed files with 62 additions and 44 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue