aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
authorCarlo Nucera <carlo.nucera@protonmail.com>2020-07-16 13:36:01 -0400
committerCarlo Nucera <carlo.nucera@protonmail.com>2020-07-16 13:36:01 -0400
commit745a03cef5977e3474dcf8ef43cb721a6a7cac8e (patch)
tree2c6b0a9ad5bcdddbc8ca0fdc1693092d2e726aff /src/libutil/util.hh
parent230c9b4329b3d285e57f4cce058c121256187da1 (diff)
parent048e916f6477acc7e57e1d85e832d3efb42ad3f6 (diff)
Merge branch 'optional-derivation-output-storepath' of github.com:obsidiansystems/nix into ca-derivation-data-types
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index d38657843..630303a5d 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -49,7 +49,9 @@ void clearEnv();
/* Return an absolutized path, resolving paths relative to the
specified directory, or the current directory otherwise. The path
is also canonicalised. */
-Path absPath(Path path, std::optional<Path> dir = {});
+Path absPath(Path path,
+ std::optional<Path> dir = {},
+ bool resolveSymlinks = false);
/* Canonicalise a path by removing all `.' or `..' components and
double or trailing slashes. Optionally resolves all symlink
@@ -147,10 +149,12 @@ Path getDataDir();
Paths createDirs(const Path & path);
/* Create a symlink. */
-void createSymlink(const Path & target, const Path & link);
+void createSymlink(const Path & target, const Path & link,
+ std::optional<time_t> mtime = {});
/* Atomically create or replace a symlink. */
-void replaceSymlink(const Path & target, const Path & link);
+void replaceSymlink(const Path & target, const Path & link,
+ std::optional<time_t> mtime = {});
/* Wrappers arount read()/write() that read/write exactly the