temporary files - what is the resolution?

Jonathan M Davis jmdavisProg at gmx.com
Fri Jul 27 13:01:37 PDT 2012


On Friday, July 27, 2012 12:44:40 Brad Roberts wrote:
> On Fri, 27 Jul 2012, Jonathan M Davis wrote:
> > On Friday, July 27, 2012 17:37:20 Marco Leise wrote:
> > > P.S.: There is a _mktemp_s in MS CRT, but it allows for only 26 unique
> > > names per calling thread, directory and prefix :p
> > 
> > Yes. And some POSIX systems have exactly the same problem with mkstemp.
> > And
> > given how easy it is to write a function which just generates a random
> > file
> > name, I see no reason to deal with nonsense like that. As far as I can
> > tell, _every_ C function for generating either a random file or a random
> > file name has a caveat of some sort.
> 
> Which has that limit?  I haven't found one yet.

Here's one page that talks about it, but I've seen other pages mentioning it 
when searching previously:

http://www.gnu.org/software/gnulib/manual/html_node/mkstemp.html

I do not believe that any of the platforms that we currently support have that 
particular problem, but I'm not about to trust an OS function that varies that 
much from platform to platform when I can easily create a solution which is 
guaranteed to work across all of the platforms that we support and will do so 
consistently.

- Jonathan M Davis


More information about the Digitalmars-d mailing list