From owner-freebsd-hackers Sat Jan 13 16:56:14 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA01703 for hackers-outgoing; Sat, 13 Jan 1996 16:56:14 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA01654 Sat, 13 Jan 1996 16:56:02 -0800 (PST) From: Josh MacDonald Message-Id: <199601130243.SAA08722@paris.CS.Berkeley.EDU> To: Terry Lambert cc: jmacd@cs.berkeley.edu (Josh MacDonald), nate@sri.mt.net, freebsd-hackers@freebsd.org, jmacd@paris.CS.Berkeley.EDU Subject: Re: mktemp() sucks, why not fix it? In-reply-to: Your message of "Fri, 12 Jan 1996 14:35:25 MST." <199601122135.OAA20866@phaeton.artisoft.com> Date: Fri, 12 Jan 1996 18:43:55 -0800 Sender: owner-hackers@freebsd.org Precedence: bulk > > > > > > Sorry, that my strings were not writable misses the point. > > That was my contrived example to illustrate the real problem, > > which is not addressed by what you wrote. > > > > Say that I malloced those segments and reread my message, that > > wasn't the problem. I was calling mktemp on heap allocated > > memory segments in my program when I stumbled upon this problem. > > mktemp() creates a file name. > > mktemp() does not create a file. > > mktemp() will "uniquify" the file name between calls only if the > file exists (from the error returns in the man page, you can see > it stats the target). > > > Probably you want to use the tmpfile() interface instead of > reimplementing its functionality anyway. > > > > Terry Lambert > terry@lambert.org > --- > Any opinions in this posting are my own and not those of my present > or previous employers. Except I need to make symlinks as well as real files, depending on certain conditions. Directories as well.. I have modified the source and am including it in my program. -josh