STINNER Victor <vstin...@redhat.com> added the comment:

cow.diff: I'm not sure that attempt to call unlink() if FICLONE fails is a good 
idea. unlink() can raise a new exception which can be confusing. IMHO it's up 
to the caller to deal with that. Said differently, I dislike the *fallback* 
parameter of reflink().

Why not exposing clonefile() as os.clonefile() but os._clonefile()?

+#if defined(MAC_OS_X_VERSION_10_12)
+#include <sys/clonefile.h>
+#define HAVE_CLONEFILE
+#endif

Is Python compiled to target macOS 10.12 and newer? 
Mac/BuildScript/build-installer.py contains:

# $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level
DEPTARGET = '10.5'

But I don't know well macOS. "#if defined(MAC_OS_X_VERSION_10_12)" is a check 
at build time. Does it depend on DEPTARGET? Would it be possible to use a 
runtime check?

You might open a dedicated issue to expose clonefile() since it seems like 
every tiny detail of this issue is very subtle and should be properly discussed 
;-) (I like the idea of exposing native functions like clonefile() directly in 
the os module!)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37157>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to