BloombergLP::bdls::FilesystemUtil::createTemporaryDirectory

Create a new directory with a name constructed by appending an automatically-generated suffix to the specified prefix. A non-zero return value indicates that no such directory could be created; otherwise the name of the directory created is assigned to the specified outPath. The directory is created with permissions restricted, as closely as possible, to the caller only. If the prefix is a relative path, the directory is created relative to the process current directory. Responsibility for deleting the directory (and any files subsequently created in it) is left to the caller.

Synopsis

Declared in <bdls_filesystemutil.h>

static
int
createTemporaryDirectory(
    bsl::string* outPath,
    std::string_view const& prefix);