Skip to content

Commit

Permalink
switch to mtime resolution measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Sep 11, 2024
1 parent a321934 commit f9c9626
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions fileformats/core/fs_mount_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ def get_mtime_resolution(cls, path: PathLike) -> int:
the root of the mount the path sits on
fstype : str
the type of the file-system (e.g. ext4 or cifs)"""
mount_point, fstype = cls.get_mount(path)
try:
resolution = cls.FS_MTIME_NS_RESOLUTION[fstype]
except KeyError:
try:
resolution = cls.measure_mtime_resolution(mount_point)
except (RuntimeError, OSError):
# Fallback to the largest known mtime
resolution = max(cls.FS_MTIME_NS_RESOLUTION.values())
mount_point, _ = cls.get_mount(path)
# try:
# resolution = cls.FS_MTIME_NS_RESOLUTION[fstype]
# except KeyError:
# try:
resolution = cls.measure_mtime_resolution(mount_point)
# except (RuntimeError, OSError):
# # Fallback to the largest known mtime
# resolution = max(cls.FS_MTIME_NS_RESOLUTION.values())
return resolution

@classmethod
Expand Down

0 comments on commit f9c9626

Please sign in to comment.