[TxMt] Re: Issue saving tmp files in Catalina?

Allan Odgaard mailinglist at textmate.org
Sun Apr 19 13:45:23 UTC 2020


On 19 Apr 2020, at 18:40, Matt Neuburg wrote:

> I’m not sure I believe that. Safe save is in fact one of the boasts 
> of APFS. You ask for safe save, which causes the file system to clone 
> the file and now you get copy-on-write automatically, which is far 
> more efficient because only the changed blocks actually need to be 
> written. When you’re done saving, the original is atomically swapped 
> with the clone. m.

Before APFS we had `exchangedata` which atomically swaps the data part 
of two files. Majority of applications derive no advantage from first 
cloning the file to be updated, they simply write out a new file and 
then swap it with the old one. In-place/partial update of a file during 
save is for applications where the file may be too big to hold in 
memory, like a disk image or a database backend, but require a specially 
crafted file format to support this.

After APFS we have to use `rename` for atomically overwriting the old 
file, but that has the disadvantages I listed in my email.

What you may have seen regarding atomic save and APFS is that Apple 
extended rename to also allow atomic renaming of directories even when 
the destination exist. This allows atomic save of bundles, which 
previously was not possible. But it is unrelated to my grief about APFS 
dropping support for `exchangedata`.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macromates.com/textmate/attachments/20200419/73da5853/attachment.html>


More information about the TextMate mailing list