aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-03-30 19:14:17 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-03-30 19:16:45 +0200
commite1a94ad852e91fcdcf4efb60fe7e9b9e328df7ac (patch)
tree3bae2236d6bd11e3960394b99278191de021eff8 /src/libutil/util.hh
parent367577d9a6ec465d773f7b3ba53a5656253f514d (diff)
Backport 'nix dev-shell' from the flakes branch
This also adds a '--profile' option to 'nix build' (replacing 'nix-env --set').
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 7c3a30242..1f85c7c46 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -122,10 +122,6 @@ void deletePath(const Path & path);
void deletePath(const Path & path, unsigned long long & bytesFreed);
-/* Create a temporary directory. */
-Path createTempDir(const Path & tmpRoot = "", const Path & prefix = "nix",
- bool includePid = true, bool useGlobalCounter = true, mode_t mode = 0755);
-
std::string getUserName();
/* Return $HOME or the user's home directory from /etc/passwd. */
@@ -205,6 +201,14 @@ public:
};
+/* Create a temporary directory. */
+Path createTempDir(const Path & tmpRoot = "", const Path & prefix = "nix",
+ bool includePid = true, bool useGlobalCounter = true, mode_t mode = 0755);
+
+/* Create a temporary file, returning a file handle and its path. */
+std::pair<AutoCloseFD, Path> createTempFile(const Path & prefix = "nix");
+
+
class Pipe
{
public: