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



The atomicity needs to occur at the
    generate unique temp filename
    create the file
    open the file

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


On Sep 29, 2005, at 9:07 AM, Mike Kluev wrote:

On Thu, 29 Sep 2005 08:42:53, Matt Gough <email@hidden> wrote:


On 28 Sep 2005, at 20:07, Mike Kluev wrote:


... We don't even have atomic "create-open" in File Manager...


Haven't tried it myself, but in 10.4 I suspect that the following does exactly that:

OSStatus  FSCreateFileAndOpenForkUnicode(const FSRef *parentRef,
UniCharCount nameLength, const UniChar *name, FSCatalogInfoBitmap
whichInfo, const FSCatalogInfo *catalogInfo, UniCharCount
forkNameLength, const UniChar *forkName, SInt8 permissions, SInt16
*forkRefNum, FSRef *newRef);


Cool, thanks! Is it atomic?

Mike

 _______________________________________________
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


_______________________________________________ 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: Mike Kluev <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.