![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
Go to the source code of this file.
Functions | |
| void | nix::dumpPath (const std::filesystem::path &path, Sink &sink, PathFilter &filter) |
| time_t | nix::dumpPathAndGetMtime (const std::filesystem::path &path, Sink &sink, PathFilter &filter) |
| void | nix::dumpString (std::string_view s, Sink &sink) |
| void | nix::parseDump (FileSystemObjectSink &sink, Source &source) |
| void | nix::restorePath (const std::filesystem::path &path, Source &source, bool startFsync, RestoreSinkHooks *hooks) |
| void | nix::copyNAR (Source &source, Sink &sink) |
Variables | |
| constexpr size_t | nix::narMaxDepth = 64 |
| constexpr std::string_view | nix::narVersionMagic1 = "nix-archive-1" |
| constexpr std::string_view | nix::caseHackSuffix = "~nix~case~hack~" |
| void nix::dumpPath | ( | const std::filesystem::path & | path, |
| Sink & | sink, | ||
| PathFilter & | filter = defaultPathFilter ) |
dumpPath creates a Nix archive of the specified path.
| path | the file system data to dump. Dumping is recursive so if this is a directory we dump it and all its children. | |
| [out] | sink | The serialised archive is fed into this sink. |
| filter | Can be used to skip certain files. |
The format is as follows:
| time_t nix::dumpPathAndGetMtime | ( | const std::filesystem::path & | path, |
| Sink & | sink, | ||
| PathFilter & | filter = defaultPathFilter ) |
Same as dumpPath(), but returns the last modified date of the path.
| void nix::dumpString | ( | std::string_view | s, |
| Sink & | sink ) |
Dump an archive with a single file with these contents.
| s | Contents of the file. |
| void nix::restorePath | ( | const std::filesystem::path & | path, |
| Source & | source, | ||
| bool | startFsync, | ||
| RestoreSinkHooks * | hooks ) |
| path | Root where to unpack the NAR. |
| source | NAR source |
| hooks | Hooks for canonicalising metadata. |
|
constexpr |
Maximum directory nesting depth for dumpPath()/parseDump(). Bounds stack usage so deep trees cannot overflow the (possibly coroutine) stack these run on.
Other code writing out file system objects can use this too, so that whatever it writes can also be dumped as a NAR.