Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function to generate a temporary filename



That's what the tempname functions are for. So you don't have to check the error and keep retrying. Especially if your goal is just to call FSExchangeObjects in the end.

Ack, at 9/29/05, Scott Ribe said:

> FSCreateFileAndOpenForkUnicode doesn't addess steps 1 and 2. I
believe it is atomic w.r.t steps 2 and 3.

Why would you require atomicity with 1 & 2? Until the file is created, there is no opportunity for an attacker to try to snag it and fill it in. Yes, another process could inadvertently create a file with the same name, but that's easy enough to handle by checking error return and retrying.

--


Sincerely, Rosyna Keller Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Function to generate a temporary filename (From: Scott Ribe <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.