Friday, October 27, 2023

iCloud Drive Switches to Dataless Files

Howard Oakley:

In the recent past, when a file has been evicted to iCloud (its download being removed from local storage), it has been represented by a placeholder or stub file in its original folder on the Mac. Taking the file named MyDocument.extn as an example, in the more distant past it might have been represented by a stub file named .MyDocument.extn-tef.icloud, but more recently that would have been named .MyDocument.extn.icloud, and was typically less than 200 bytes in size.

Stub files retained all their original extended attributes, including any Resource fork, and when their data was downloaded from iCloud they were reconstituted into their original files, original names, extended attributes and all.


I was surprised to discover that upgrading to Sonoma has brought radical change to iCloud Drive, specifically in the way that it handles evicted files in local storage. […] There are no stub files to be seen, and the only indication that these files are evicted and not stored locally is in their Status: evicted files are shown as NotDownloaded, while those stored locally are Current.


I suspect these new evicted files take advantage of a trick in APFS: as far as I can tell, they consist of the file with its attributes and extended attributes intact and stored locally, but no extents for its data. Thus, when you ask for the file size, it returns the size it would be when downloaded, although the file only takes the space required for its attributes and extended attributes, until it has been downloaded. As Apple promised, these are dataless files.

Michael Bach:

Interestingly, in Sonoma the path to Trash has also changed. It is now $HOME/Library/Mobile\ Documents/.Trash and used to be $HOME/Library/Mobile\ com\~apple\~CloudDocs/.Trash (or so).


Comments RSS · Twitter · Mastodon

Leave a Comment