This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <1559710944.6.0.337423483032.issue37157@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-06-05 05:02:24giampaolo.rodolasetrecipients: + giampaolo.rodola, vstinner, pablogsal
2019-06-05 05:02:24giampaolo.rodolasetmessageid: <1559710944.6.0.337423483032.issue37157@roundup.psfhosted.org>
2019-06-05 05:02:24giampaolo.rodolalinkissue37157 messages
2019-06-05 05:02:24giampaolo.rodolacreate