Re: Is cloning the same as copying in APFS?
Re: Is cloning the same as copying in APFS?
- Subject: Re: Is cloning the same as copying in APFS?
- From: Sandor Szatmari <email@hidden>
- Date: Mon, 26 Jun 2017 23:00:03 -0400
> On Jun 26, 2017, at 22:45, Quincey Morris
> <email@hidden> wrote:
>
>> On Jun 26, 2017, at 19:17 , Sandor Szatmari <email@hidden>
>> wrote:
>>
>> Are you talking about just a regular old copy or a copy in the sense of a
>> time machine backup? Are these behaviors different on APFS?
>
> Yes and no. A regular old copy will create metadata for a new file, and point
> back to the data blocks of the copied file. A time machine backup will create
> a snapshot, which is effect a copy of all the metadata in the volume, with
> the same shared pointers to the data blocks.
Yes, I felt the description of the copy on write behavior was intended to be
universal to all copy operations not just a special operation reserved for time
machine. But, my even more admittedly vague understanding did not allow me to
confidently draw a distinction be tween the two. Thank you for tipping the
scales.
>
> In both cases, the functionality relies on the copy-on-write behavior, which
> works at the data block level, not the file level.
Yes, this is very nice...
> (The latter point is worth keeping in mind, because it means that deleting
> files in APFS may not recover all of the file’s size into free space.)
The ADC video stresses this point several times.
>
>> On Jun 26, 2017, at 19:38 , Rick Mann <email@hidden> wrote:
>>
>> But there's actually a POSIX "clone" API, and so I wonder if a copy is
>> different from a clone.
>
> My (admittedly vague) understanding is that all file system copy operations
> are expected to be clones. I would imagine the difference between the APIs to
> be that a “copy" will do a traditional duplication if the source file is
> uncloneable (e.g. on a non-APFS volume), but the “clone” would fail.
>
> But it would be a big hole if existing apps that copy items didn’t get the
> cloning behavior by default.
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden