[TxMt] Atomic Saving / Saving Question

Chris Thomas chris at m-audio.com
Tue Feb 8 17:43:54 UTC 2005


On Feb 8, 2005, at 9:00 AM, Sune Foldager wrote:

> On 7. feb 2005, at 18:29, Chris Thomas wrote:
>> However, it appears that this discussion is academic, because HFS+'s 
>> implementation of exchangedata actually returns an error if one of 
>> the files is hardlinked.
> Huh? If I have file A hard linked with B and I "atomically" replace A 
> (i.e. write A.new, move A.new to A) then I will break the link between 
> A and B. That's the issue here, and that's certainly what happens in 
> the scenario I just described :-). No HFS+ errors here.

Right, but I'm talking specifically about the exchangedata system call 
(or FSExchangeObjects). exchangedata is a Darwin VFS operation. It 
calls into the file system implementation to perform the atomic 
exchange. For HFS+, it explicitly preserves the file ID. I had assumed 
it would preserve hardlinks as well, but it turns out that it just 
errors out if one of the files is hardlinked (or has ever been 
hardlinked).

Chris



More information about the textmate mailing list