Message344667
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:24 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, vstinner, pablogsal |
2019-06-05 05:02:24 | giampaolo.rodola | set | messageid: <1559710944.6.0.337423483032.issue37157@roundup.psfhosted.org> |
2019-06-05 05:02:24 | giampaolo.rodola | link | issue37157 messages |
2019-06-05 05:02:24 | giampaolo.rodola | create | |
|