Re: Creating temporary files?
Re: Creating temporary files?
- Subject: Re: Creating temporary files?
- From: Per Persson <email@hidden>
- Date: Sat, 22 Jun 2002 18:35:38 +0200
On Friday, June 21, 2002, at 01:39 PM, Dinu Gherman wrote:
Isn't there some standard way to create a temp file
Check out the C functions tmpfile() and tmpnam().
sherm--
You should probably be careful with tempnam() since it seems to be
broken. The following snippet:
printf("tmpnam:\n");
for (i=0;i<3;i++)
printf("%s\n", tmpnam(NULL));
printf("tempnam:\n");
for (i=0;i<3;i++)
printf("%s\n", tempnam(NULL,NULL));
produces:
tmpnam:
/var/tmp/tmp.0.005374
/var/tmp/tmp.1.005374
/var/tmp/tmp.2.005374
tempnam:
/var/tmp/tmp.005374
/var/tmp/tmp.005374
/var/tmp/tmp.005374
i.e. tempnam() returns the same filename every time.
I filed a bug with Apple some months ago, but haven't heard anything.
/Per
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.