[#BloombergLP-bdls-FilesystemUtil-createTemporaryFile-08] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::createTemporaryFile :relfileprefix: ../../../ :mrdocs: `createTemporaryFile` overloads == Synopses Declared in `<bdls_filesystemutil.h>` Create and open a new file with a name constructed by appending an automatically‐generated suffix to the specified `prefix`, and return its file descriptor open for reading and writing. A return value of `k_INVALID_FD` indicates that no such file could be created; otherwise, the name of the file created is assigned to the specified `outPath`. The file is created with permissions restricted, as closely as possible, to the caller`s userid only. If the prefix is a relative path, the file is created relative to the process current directory. Responsibility for deleting the file is left to the caller. Note that on Posix systems, if `outPath` is unlinked immediately, the file will remain usable until its descriptor is closed. Note that files created on Microsoft Windows may receive default, not restricted permissions. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FileDescriptor] xref:BloombergLP/bdls/FilesystemUtil/createTemporaryFile-03.adoc[createTemporaryFile]( xref:bsl/string.adoc[bsl::string]* outPath, std::string_view const& prefix); ---- [.small]#xref:BloombergLP/bdls/FilesystemUtil/createTemporaryFile-03.adoc[_» more..._]# Same as the overload taking `bsl::string *`, using `std::pmr::string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FileDescriptor] xref:BloombergLP/bdls/FilesystemUtil/createTemporaryFile-02.adoc[createTemporaryFile]( std::pmr::string* outPath, std::string_view const& prefix); ---- [.small]#xref:BloombergLP/bdls/FilesystemUtil/createTemporaryFile-02.adoc[_» more..._]# Same as the overload taking `bsl::string *`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FileDescriptor] xref:BloombergLP/bdls/FilesystemUtil/createTemporaryFile-00.adoc[createTemporaryFile]( std::string* outPath, std::string_view const& prefix); ---- [.small]#xref:BloombergLP/bdls/FilesystemUtil/createTemporaryFile-00.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#