[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkstemps

From: Bruno Haible
Subject: Re: mkstemps
Date: Mon, 29 Jun 2009 17:36:54 +0200
User-agent: KMail/1.9.9

Eric Blake wrote:
> git recently started using mkstemps on systems that provide it (new enough
> Solaris has it in <stdlib.h>, some BSD have it in <unistd.h> even though
> it is not standardized,

Indeed, the platforms that have it are: OpenBSD >= 2.4, FreeBSD >= 2.4,
MacOS X [1], OpenSolaris [2].

> I've just proposed adding it to Cygwin via newlib).  The general idea of
> creating temporary files with a known suffix is nice.

It can also be done by using mkdtemp and then creating a file with arbitrary
name in the temporary directory. That approach is also more extensible: It
allows not only the suffix, but the entire file name to be a given one. It
keeps several temporary files from a single process together. It reduces the
amount of directory entries in /tmp.

> Should we modify tempname.c's gen_tempname to also provide the 
> ability to implement mkstemps?

If you find this function worth using, no objection.


[2] http://docs.sun.com/app/docs/doc/819-2243/mkstemps-3c?a=view

reply via email to

[Prev in Thread] Current Thread [Next in Thread]