[#BloombergLP-bdls-FilesystemUtil-createTemporarySubdirectory-058] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::createTemporarySubdirectory :relfileprefix: ../../../ :mrdocs: Create a new temporary directory under `rootDirectory`. == Synopsis Declared in `<bdls_filesystemutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int createTemporarySubdirectory( xref:bsl/string.adoc[bsl::string]* outPath, std::string_view const& rootDirectory, std::string_view const& prefix); ---- == Description Create a new directory with a name constructed by appending an automatically‐generated suffix to the specified `prefix` within the specified `rootDirectory`. 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 `rootDirectory` 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. == Return Value 0 on success, and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *outPath* | receives the path of the created directory | *rootDirectory* | directory in which to create the subdirectory | *prefix* | prefix of the generated directory name |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#