From 10e10f9535dc371ccdadfa831a695a5a503eec7e Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sun, 23 Sep 2018 13:29:18 +0300 Subject: [PATCH] reflink: osx: check that not older than High Sierra Signed-off-by: Ruslan Kuprieiev --- dvc/system.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dvc/system.py b/dvc/system.py index 1a3aac2ee..56121e7c1 100644 --- a/dvc/system.py +++ b/dvc/system.py @@ -36,6 +36,13 @@ class System(object): @staticmethod def _reflink_darwin(src, dst): import ctypes + import platform + + version = platform.mac_ver()[0] + major, minor, patch = version.split('.') + # Starting from High Sierra + if major < 10 or (major == 10 and minor < 13): + return -1 clonefile = ctypes.CDLL('libc.dylib').clonefile clonefile.argtypes = [ctypes.c_char_p,