Function rcpputils::fs::create_temp_directory
Defined in File filesystem_helper.hpp
Function Documentation
-
path rcpputils::fs::create_temp_directory(const std::string &base_name, const path &parent_path = path(std::filesystem::temp_directory_path().generic_string()))
Construct a uniquely named temporary directory, in “parent”, with format base_nameXXXXXX.
The output, if successful, is guaranteed to be a newly-created directory. The underlying implementation keeps generating paths until one that does not exist is found. This guarantees that there will be no existing files in the returned directory.
- Parameters:
base_name – [in] User-specified portion of the created directory
parent_path – [in] The parent path of the directory that will be created
- Throws:
std::system_error – If any OS APIs do not succeed.
- Returns:
A path to a newly-created directory with base_name and a 6-character unique suffix