Files
lix/lix/libstore/temporary-dir.hh
T
Emily 6aedc0ee70 libstore: make temporary path prefixes optional
This is not the same thing as passing an empty string, because it
avoids the `-` separator.

Change-Id: I6a6a69646aa76953078a08c606e8f82c9ec03e8e
2025-08-18 09:27:31 +00:00

24 lines
480 B
C++

#pragma once
///@file
#include "lix/libutil/file-system.hh"
namespace nix {
/**
* Create a temporary directory.
*/
Path createTempDir(const std::optional<Path> & prefix = "nix", mode_t mode = 0755);
/**
* Create a temporary file, returning a file handle and its path.
*/
std::pair<AutoCloseFD, Path> createTempFile(const Path & prefix = "nix");
/**
* Return settings.tempDir, `TMPDIR`, or the default temporary directory if unset or empty.
*/
Path defaultTempDir();
}