[llvm] r327851 - Changed createTemporaryFile without FD to actually create a file.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 14:16:25 PDT 2018


Ilya Biryukov via llvm-commits <llvm-commits at lists.llvm.org> writes:

> +/// @brief Get a unique name, not currently exisiting in the filesystem. Subject
> +/// to race conditions, prefer to use createUniqueFile instead.
> +///
> +/// Similar to createUniqueFile, but instead of creating a file only
> +/// checks if it exists. This function is subject to race conditions, if you
> +/// want to use the returned name to actually create a file, use
> +/// createUniqueFile instead.
> +std::error_code getPotentiallyUniqueFileName(const Twine &Model,
> +                                             SmallVectorImpl<char> &ResultPath);
> +
> +/// @brief Get a unique temporary file name, not currently exisiting in the
> +/// filesystem. Subject to race conditions, prefer to use createTemporaryFile
> +/// instead.
> +///
> +/// Similar to createTemporaryFile, but instead of creating a file only
> +/// checks if it exists. This function is subject to race conditions, if you
> +/// want to use the returned name to actually create a file, use
> +/// createTemporaryFile instead.
> +std::error_code
> +getPotentiallyUniqueTempFileName(const Twine &Prefix, StringRef Suffix,
> +                                 SmallVectorImpl<char> &ResultPath);
> +

Do we have any use for these?

Cheers,
Rafael


More information about the llvm-commits mailing list