Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site bbncc5.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!bbnccv!bbncc5!keesan
From: keesan@bbncc5.UUCP (Morris M. Keesan)
Newsgroups: net.unix-wizards
Subject: Re: tempnam/mktemp
Message-ID: <471@bbncc5.UUCP>
Date: Tue, 20-Aug-85 17:29:26 EDT
Article-I.D.: bbncc5.471
Posted: Tue Aug 20 17:29:26 1985
Date-Received: Fri, 23-Aug-85 05:49:56 EDT
References: <458@baylor.UUCP>
Reply-To: keesan@bbncc5.UUCP (Morris M. Keesan)
Distribution: net
Organization: Bolt Beranek and Newman, Cambridge, MA
Lines: 11

In article <458@baylor.UUCP> peter@baylor.UUCP (Peter da Silva) writes:
>If tempnam/mktemp does anything more than sprintf(fname, "/tmp/tmp%d%d",
>getpid(), cnt++), what it does escapes me. 

mktemp returns a file name that is guaranteed not to exist (modulo race
conditions), which affords you some protection against bozos who are
making temp files using rand() instead of getpid(), e.g.
-- 
Morris M. Keesan
keesan@bbn-unix.ARPA
{decvax,ihnp4,etc.}!bbncca!keesan