2024-07-01 11:12:34 -04:00
|
|
|
#include <iostream>
|
|
|
|
#include "tracing-file-system-object-sink.hh"
|
|
|
|
|
|
|
|
namespace nix::test {
|
|
|
|
|
2024-07-11 06:14:48 -04:00
|
|
|
void TracingFileSystemObjectSink::createDirectory(const CanonPath & path)
|
2024-07-01 11:12:34 -04:00
|
|
|
{
|
|
|
|
std::cerr << "createDirectory(" << path << ")\n";
|
|
|
|
sink.createDirectory(path);
|
|
|
|
}
|
|
|
|
|
2024-07-11 06:14:48 -04:00
|
|
|
void TracingFileSystemObjectSink::createRegularFile(
|
|
|
|
const CanonPath & path, std::function<void(CreateRegularFileSink &)> fn)
|
2024-07-01 11:12:34 -04:00
|
|
|
{
|
|
|
|
std::cerr << "createRegularFile(" << path << ")\n";
|
|
|
|
sink.createRegularFile(path, [&](CreateRegularFileSink & crf) {
|
|
|
|
// We could wrap this and trace about the chunks of data and such
|
|
|
|
fn(crf);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-07-11 06:14:48 -04:00
|
|
|
void TracingFileSystemObjectSink::createSymlink(const CanonPath & path, const std::string & target)
|
2024-07-01 11:12:34 -04:00
|
|
|
{
|
|
|
|
std::cerr << "createSymlink(" << path << ", target: " << target << ")\n";
|
|
|
|
sink.createSymlink(path, target);
|
|
|
|
}
|
|
|
|
|
2024-07-11 06:14:48 -04:00
|
|
|
void TracingExtendedFileSystemObjectSink::createHardlink(const CanonPath & path, const CanonPath & target)
|
2024-07-01 11:12:34 -04:00
|
|
|
{
|
|
|
|
std::cerr << "createHardlink(" << path << ", target: " << target << ")\n";
|
|
|
|
sink.createHardlink(path, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace nix::test
|