mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Merge pull request #1242 from efiop/master
system: add workaround for buggy os.lstat().st_ino
This commit is contained in:
@@ -178,7 +178,12 @@ class System(object):
|
||||
@staticmethod
|
||||
def inode(path):
|
||||
if System.is_unix():
|
||||
import ctypes
|
||||
inode = os.lstat(path).st_ino
|
||||
# NOTE: See https://bugs.python.org/issue29619 and
|
||||
# https://stackoverflow.com/questions/34643289/
|
||||
# pythons-os-stat-is-returning-wrong-inode-value
|
||||
inode = ctypes.c_ulong(inode).value
|
||||
else:
|
||||
# getdirinfo from ntfsutils works on both files and dirs
|
||||
info = System.getdirinfo(path)
|
||||
|
||||
Reference in New Issue
Block a user