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

David Majnemer david.majnemer at gmail.com
Fri Jul 25 13:31:42 PDT 2014


I have a few concerns:
1. GetTempPathW is buggy, we should be manually
using GetEnvironmentVariableW with TMP, TEMP and USERPROFILE arguments and
use the first that exists.
2. We should make sure that the platform specific pieces live in their
respective Path.inc files.


On Thu, Jul 24, 2014 at 9:44 AM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

>
> > 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.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140725/d4bef054/attachment.html>


More information about the llvm-dev mailing list