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: Quincey Morris <email@hidden>
- Date: Mon, 26 Jun 2017 19:45:16 -0700
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.
In both cases, the functionality relies on the copy-on-write behavior, which
works at the data block level, not the file level. (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.)
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