corinthia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis E. Hamilton" <dennis.hamil...@acm.org>
Subject RE: [12/38] incubator-corinthia git commit: Get rid of DFCreateTempDir
Date Fri, 13 Feb 2015 10:00:29 GMT
Out of curiosity, is there a way to create a temporary output *file* on Windows that does not
have the race condition?  I thought that was possible with a write-exclusive must-not-exist
temporary, and collisions could be detected and recovered from.

That may not be needed here, but it would be useful to know how to do it for other tools that
might have multiple instances running and also left-overs from earlier executions.

Once the new exclusive file can be opened for output, that should signal that a directory
with a related name is also available, so long as the convention of reserving names this way
is used by all executions of shared code.

 - Dennis

-----Original Message-----
From: jani@apache.org [mailto:jani@apache.org] 
Sent: Friday, February 13, 2015 00:52
To: commits@corinthia.incubator.apache.org
Subject: [12/38] incubator-corinthia git commit: Get rid of DFCreateTempDir

[ ... ]

DFCreateTempDir used to rely on mkdtemp, which generates temporary
directories in a secure manner (that is, avoiding a race condition
between the directory's creation time and the application getting
exclusive access to it). However, this function is not available on
windows, leaving us with the choice of having an #ifdef WIN32 to use a
fixed directory name on windows, or doing the same thing on all
platforms. Compiling on Linux would give a warning about the mktemp
function being unsafe.


[ ... ]


Mime
View raw message