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

Re: temp files under C



Brian May <bam@debian.org> wrote:

> what is the safest way to open/create a temporary file under C, and
> get a string with the filename?

Call any function that returns a filename, then open it with O_EXCL, and
finally fdopen it if you need a FILE *.
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



Reply to: