Author giampaolo.rodola
Recipients giampaolo.rodola, pablogsal, vstinner
Date 2019-06-05.05:02:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm attaching an initial PoC using FICLONE on Linux and clonefile(3) on OSX. It is also possible to support Windows but it requires a ReFS partition to test against which I currently don't have.  I opted for exposing reflink() as a separate function, mostly because:

- conceptually standard copy and CoW copy are 2 different things
- shutil already provides a distinction between copy functions (copy(), copy2(), copyfile()) which can be used as callbacks for copytree() and move(). As such one can follow the same approach and do:

   >>> copytree(src, dst, copy_function=reflink).

This initial patch provides a callback=None parameter in case the CoW operation fails because not supported by the underlying filesystems but this is debatable because we can get different errors depending on the platform (which is not good). As such a more generic ReflinkNotSupportedError exception is probably a better choice.
Date User Action Args
2019-06-05 05:02:24giampaolo.rodolasetrecipients: + giampaolo.rodola, vstinner, pablogsal
2019-06-05 05:02:24giampaolo.rodolasetmessageid: <>
2019-06-05 05:02:24giampaolo.rodolalinkissue37157 messages
2019-06-05 05:02:24giampaolo.rodolacreate