Perfect,

 

               You eventually landed on using _mktemp_s which is what
described in the first link I provided you with and is what I was hoping for
Windows.

 

Thanks a lot,

Maurizio

 

 

From: Gustaf Neumann [mailto:neum...@wu.ac.at] 
Sent: 28 September 2014 16:56
To: naviserver-devel@lists.sourceforge.net
Subject: Re: [naviserver-devel] no mkstemp() on Windows, use
TclpCreateTempFile()?

 

mktemp() is useful, but is in in the unix world general strongly 
discouraged in favor of mkstemp(). The problem with mktemp()  + file-create 
is, that in the time between the pathname is constructed and the file is
created,
another process might have created a file with the same name. mkstemp() is 
actually guaranteed to create a unique file. 

For the time being, i've commited a small implementation of mkstemp() for
windows,
that opens files with O_EXCL, which should be a first approximation.
However,
it's not tested, please test it and don't be surprised, if it needs more
tweaks
(maybe my flag settings are too restrictive).

all the best
-g

Am 27.09.14 16:11, schrieb Andrew Piskorski:

On Fri, Sep 26, 2014 at 08:55:37PM +0200, Maurizio Martignano wrote:

Dear Andrew and Gustaf,
   I believe this is the function you are looking for:
 
http://msdn.microsoft.com/en-us/library/ms235413.aspx

 
No, it is not.  mktemp and friends merely generate a file name, while
mkstemp also opens the file and returns a file handle.  So yes, you
could use mktemp as part of an implementation of mkstemp, but they do
are not replacements for each other.
 

 

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to