Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::FileSystemObjectSink Struct Referenceabstract
Inheritance diagram for nix::FileSystemObjectSink:
nix::MemorySink nix::NullFileSystemObjectSink nix::RegularFileSink nix::RestoreSink

Public Types

using DirectoryCreatedCallback = fun<void(FileSystemObjectSink & dirSink, const CanonPath & dirRelPath)>

Public Member Functions

virtual void createDirectory (const CanonPath &path)=0
virtual void createDirectory (const CanonPath &path, DirectoryCreatedCallback callback)
virtual void createRegularFile (const CanonPath &path, fun< void(CreateRegularFileSink &)>)=0
virtual void createSymlink (const CanonPath &path, const std::string &target)=0

Member Function Documentation

◆ createDirectory() [1/2]

virtual void nix::FileSystemObjectSink::createDirectory ( const CanonPath & path)
pure virtual

Implemented in nix::RestoreSink.

◆ createDirectory() [2/2]

virtual void nix::FileSystemObjectSink::createDirectory ( const CanonPath & path,
DirectoryCreatedCallback callback )
inlinevirtual

Create a directory and invoke a callback with a pair of sink + CanonPath of the created subdirectory relative to dirSink.

Note
This allows for UNIX RestoreSink implementations to implement *at-style accessors that always keep an open file descriptor for the freshly created directory. Use this when it's important to disallow any intermediate path components from being symlinks.

Reimplemented in nix::RestoreSink.

◆ createRegularFile()

virtual void nix::FileSystemObjectSink::createRegularFile ( const CanonPath & path,
fun< void(CreateRegularFileSink &)>  )
pure virtual

This function in general is no re-entrant. Only one file can be written at a time.

Implemented in nix::MemorySink, nix::NullFileSystemObjectSink, nix::RegularFileSink, and nix::RestoreSink.


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