Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: File saving -- how is it done?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File saving -- how is it done?




On Apr 26, 2007, at 5:00 PM, Ian Archer wrote:

I've noticed that some mac applications do file saves through what
appears to be a write'n'swap system.  One can observe something like:

/Users/name/.TemporaryItems/folders.501/TemporaryItems/(A Document
Being Saved By OmniGraffle)/test.graffle

Although at least TextEdit and probably many others do this.  My
assumption is that there is some function call or series of function
calls which accomplish this.  I can't tell whether this file is
written to, then replaced with the destination file, or whether this
is some hard link that is written to.

I am curious:
a) what is the high level call (if any) which generates this outcome
b) what are the low level commands which implement this functionality.

Thanks for any help you can provide!

If you're using Carbon File Manager APIs, you can use FSExchangeObjects on volumes that support it. I don't know if Cocoa has an equivalent. I think a lot of software just does the obvious thing: write to a file with a temporary name, delete the old file, rename the new file.


carbon-dev and cocoa-dev, depending on what you're using, would be better for questions like this as they have a lot more people subscribed to them. I think this list is more for people doing file- system related development. This is the first posting I've seen here in months.

Larry

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >File saving -- how is it done? (From: "Ian Archer" <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.