[TxMt] Atomic Saving / Saving Question

Chris Thomas chris at m-audio.com
Mon Feb 7 04:11:16 UTC 2005


On Feb 6, 2005, at 8:09 PM, Chris Thomas wrote:

> On Feb 6, 2005, at 2:42 PM, Ryan Schmidt wrote:
>> On 01.02.2005, at 11:57, Sune Foldager wrote:
>>> On 1. feb 2005, at 5:26, Paul Kline wrote:
>>>> What is atomic saving?
>>> Atomic saving makes sure that the old version of the file on disk is  
>>> replaced with the new one in on, atomic, operation. This is  
>>> sometimes needed when the files you are writing might at the same  
>>> time be read by other running programs. Technically it's writing the  
>>> file with another name, then renaming the new file into the old file  
>>> (destroying the old file in the process).
>>> The disadvantage of atomic saves (for some), is that the file gets a  
>>> new inode-number each time which will break hard-links and might  
>>> upset aliases if they are not pointing correctly.
>> Apple has been promoting this practice for ten years or more, and  
>> aliases have always worked with it in the past. As I understand it,  
>> part of the reason for Apple providing a function to do this is  
>> specifically so that aliases continue to function. The documentation  
>> [1] says that the "file ID" is preserved, though I don't know if  
>> that's the same thing as an "inode number."
> Yup, the "atomic save" checkbox could go away, or at least default to  
> "on."
>> [1]  
>> http://developer.apple.com/documentation/Carbon/Reference/ 
>> File_Manager/file_manager/function_group_21.html
> man exchangedata provides better background information. exchangedata  
> is the core VFS implementation of FSExchangeObject; it may be easier  
> to call from Cocoa.

Eh, it occurs to me that man page may not be installed on Panther. Go  
here instead:

http://developer.apple.com/qa/qa2001/qa1327.html

Chris




More information about the textmate mailing list