[LLVMdev] sys::path::system_temp_directory vs. sys::fs::createTemporaryFile

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Jul 24 09:44:06 PDT 2014


> On 2014-Jul-23, at 15:26, Jordan Rose <jordan_rose at apple.com> wrote:
> 
> Hi, all. I noticed recently that llvm::sys::fs::createTemporaryFile does not use llvm::sys::path::system_temp_directory, instead relying on its platform-specific helper TempFile. Is there any reason for this disparity?
> 
> The two implementations are not in sync, either:
> 
> - TempDir honors TMPDIR, TMP, TEMP, TEMPDIR, and a configuration-settable P_tmpdir on Unix-y systems. system_temp_directory just honors TMPDIR.
> - TempDir calls ::GetTempPathW on Windows, while system_temp_directory honors TEMP and falls back to C:\\TEMP.
> - system_temp_directory prefers DARWIN_USER_TEMP_DIR on Darwin.
> - system_temp_directory has an option for "temporary directory that persists past reboot", while TempDir is never used for anything but transient files and directories
> 
> Does anyone mind if I merge the platform-specific bits of TempDir into system_temp_directory? Does anyone have other opinions here?
> 
> Jordan

This makes sense to me.



More information about the llvm-dev mailing list