Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::RestoreSinkHooks Class Referenceabstract

#include <fs-sink.hh>

Inheritance diagram for nix::RestoreSinkHooks:
nix::CanonicalisingRestoreHooks

Public Member Functions

virtual void directoryDone (Descriptor dirFd)=0
 Called when the callback passed to nix::RestoreSink::createDirectory() returns.
virtual void regularFileCreated (Descriptor fd, bool executable)=0
virtual void symlinkCreated (Descriptor parentFd, const OsFilename &name)=0
 Called after a symlink is created.

Detailed Description

Hooks invoked when filesystem objects created by RestoreSink are complete, so callers can post-process them (e.g. metadata canonicalisation). By doing this in the hooks, the whole operation can be done in a single recursive tree traversal during unpacking.

Todo
Do something on Windows.

Member Function Documentation

◆ directoryDone()

virtual void nix::RestoreSinkHooks::directoryDone ( Descriptor dirFd)
pure virtual

Called when the callback passed to nix::RestoreSink::createDirectory() returns.

Naturally, this means that recursive copying and nix::restorePath() drives these in post-order when walking up the directory tree. This makes it suitable for canonicalising permissions of directories.

Parameters
dirFdFile descriptor of the directory.

Implemented in nix::CanonicalisingRestoreHooks.

◆ regularFileCreated()

virtual void nix::RestoreSinkHooks::regularFileCreated ( Descriptor fd,
bool executable )
pure virtual

Called when the callback passed to nix::RestoreSink::createRegularFile() returns.

Parameters
fdFile descriptor of the file.
executableWhether nix::CreateRegularFileSink::isExecutable() was called.

Implemented in nix::CanonicalisingRestoreHooks.

◆ symlinkCreated()

virtual void nix::RestoreSinkHooks::symlinkCreated ( Descriptor parentFd,
const OsFilename & name )
pure virtual

Called after a symlink is created.

Parameters
parentFdDirectory file descriptor of the symlink parent (immediate one).
nameRelative path of the symlink beneath the parent directory.

Implemented in nix::CanonicalisingRestoreHooks.


The documentation for this class was generated from the following files:
  • libutil/include/nix/util/fs-sink.hh
  • libutil/fs-sink.cc