[#BloombergLP-bdls-FilesystemUtil-makeUnsafeTemporaryFilename-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::makeUnsafeTemporaryFilename
:relfileprefix: ../../../
:mrdocs:

Construct a temporary file name by appending a suffix to `prefix`&period;

== Synopsis

Declared in `&lt;bdls&lowbar;filesystemutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
makeUnsafeTemporaryFilename(
    xref:bsl/string.adoc[bsl::string]* outPath,
    std::string&lowbar;view const& prefix);
----

== Description

Construct a file name by appending an automatically&hyphen;generated suffix to the specified `prefix`&period; The file name constructed is assigned to the specified `outPath`&period; Note that this function is called &quot;unsafe&quot; because a file with the resulting name may be created by another program before the caller has opportunity to use the name, which could be a security vulnerability, and a file with the given name may already exist where you mean to put it&period; Note that the suffix is hashed from environmental details, including any pre&hyphen;existing value of `outPath` so that if a resulting name is unsuitable (e&period;g&period; the file exists) this function may simply be called again, pointing to its previous result, to get a new, probably different name&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *outPath*
| receives the constructed file name
| *prefix*
| prefix of the generated file name
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
