David Majnemer
2014-Jul-25 20:31 UTC
[LLVMdev] sys::path::system_temp_directory vs. sys::fs::createTemporaryFile
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>
Rafael EspĂndola
2014-Jul-25 20:44 UTC
[LLVMdev] sys::path::system_temp_directory vs. sys::fs::createTemporaryFile
On 25 July 2014 16:31, David Majnemer <david.majnemer at gmail.com> wrote:> 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. >But that is orthogonal, no? If I understand correctly, Jordan's question is "do we need both system_temp_directory and TempDir"? I doesn't look like it, it seems that every user of TempDir could be replaced with system_temp_directory. Cheers, Rafael
Jordan Rose
2014-Jul-25 21:14 UTC
[LLVMdev] sys::path::system_temp_directory vs. sys::fs::createTemporaryFile
On Jul 25, 2014, at 13:44 , Rafael EspĂndola <rafael.espindola at gmail.com> wrote:> On 25 July 2014 16:31, David Majnemer <david.majnemer at gmail.com> wrote: >> 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. >> > > But that is orthogonal, no? > > If I understand correctly, Jordan's question is "do we need both > system_temp_directory and TempDir"? I doesn't look like it, it seems > that every user of TempDir could be replaced with > system_temp_directory.Well, part of my original point is that TempDir is smarter than system_temp_directory in a few ways. I suppose the Windows implementation isn't one of them.