mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 23:10:10 +01:00
localfs: use mtime/size/inode for checksum
Currently it depends on the whole `info()` output, which has too much information that doesn't really matter. To check if file contents didn't change mtime, size, inode combo is enough.
This commit is contained in:
+5
-1
@@ -39,7 +39,11 @@ class LocalFileSystem(BaseFileSystem):
|
||||
return os.path.lexists(path_info)
|
||||
|
||||
def checksum(self, path_info) -> str:
|
||||
return self.fs.checksum(path_info)
|
||||
from fsspec.utils import tokenize
|
||||
|
||||
st = os.stat(path_info)
|
||||
|
||||
return str(int(tokenize([st.st_ino, st.st_mtime, st.st_size]), 16))
|
||||
|
||||
def isfile(self, path_info) -> bool:
|
||||
return os.path.isfile(path_info)
|
||||
|
||||
Reference in New Issue
Block a user