• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is cloning the same as copying in APFS?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is cloning the same as copying in APFS?


  • Subject: Re: Is cloning the same as copying in APFS?
  • From: Charles Srstka <email@hidden>
  • Date: Tue, 27 Jun 2017 18:07:22 -0500

> On Jun 27, 2017, at 4:45 PM, Rick Mann <email@hidden> wrote:
>
>>
>> On Jun 27, 2017, at 14:30 , Charles Srstka <email@hidden
>> <mailto:email@hidden>> wrote:
>>
>>> On Jun 27, 2017, at 4:17 PM, Rick Mann <email@hidden
>>> <mailto:email@hidden>> wrote:
>>>
>>> Thanks for that, Charles!
>>>
>>> I wasn't sure because of the existence of the clonefile() call in
>>> <sys/clonefile.h>, implying that operation was different from copyfile(),
>>> but looking more closely at the sample code, I see that you can call
>>> copyfile() with COPYFILE_CLONE, which seems like it will clone if possible
>>> and copy if not.
>>>
>>> But there didn't seem to be equivalent calls in NSFileManager, hence my
>>> question.
>>
>> Apple clearly wants the clone feature to get used. :-) The ability to do a
>> copy the old way is still there if you drop down to C, but since I can’t
>> think of too many reasons to want to do that, it makes sense to leave it out
>> of the high-level API.
>
> Agreed. Thanks for the code, and for showing the other techniques. In my
> case, I still have to support HFS+, and I want to do that with hard links. I
> wish there was an API to clone-or-hardlink, but I can do that.

That should be easy enough to do. One thing I’d recommend would be checking the
volumeSupportsFileCloningKey key on URLResourceValues, rather than checking the
file system type itself. That way, if APFS gets supplanted by some even better
file system in the future, you’ll already support it.

Charles

_______________________________________________

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

  • Follow-Ups:
    • Re: Is cloning the same as copying in APFS?
      • From: Rick Mann <email@hidden>
References: 
 >Is cloning the same as copying in APFS? (From: Rick Mann <email@hidden>)
 >Re: Is cloning the same as copying in APFS? (From: Sandor Szatmari <email@hidden>)
 >Re: Is cloning the same as copying in APFS? (From: Rick Mann <email@hidden>)
 >Re: Is cloning the same as copying in APFS? (From: Jens Alfke <email@hidden>)
 >Re: Is cloning the same as copying in APFS? (From: Charles Srstka <email@hidden>)
 >Re: Is cloning the same as copying in APFS? (From: Rick Mann <email@hidden>)
 >Re: Is cloning the same as copying in APFS? (From: Charles Srstka <email@hidden>)
 >Re: Is cloning the same as copying in APFS? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: help! (book)
  • Next by Date: Re: Is cloning the same as copying in APFS?
  • Previous by thread: Re: Is cloning the same as copying in APFS?
  • Next by thread: Re: Is cloning the same as copying in APFS?
  • Index(es):
    • Date
    • Thread