Skip to content

Commit 59627bd

Browse files
author
atollk
committed
Added "supports_mtime" meta parameter to file systems.
1 parent 25083dc commit 59627bd

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

fs/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ def getmeta(self, namespace="standard"):
741741
read_only `True` if this filesystem is read only.
742742
supports_rename `True` if this filesystem supports an
743743
`os.rename` operation.
744+
supports_mtime `True` if this filesystem supports a native
745+
operation to retreive the "last modified" time.
744746
=================== ============================================
745747
746748
Most builtin filesystems will provide all these keys, and third-

fs/ftpfs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ def getmeta(self, namespace="standard"):
707707
if namespace == "standard":
708708
_meta = self._meta.copy()
709709
_meta["unicode_paths"] = "UTF8" in self.features
710+
_meta["supports_mtime"] = "MDTM" in self.features
710711
return _meta
711712

712713
def listdir(self, path):

fs/osfs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def __init__(
144144
"network": False,
145145
"read_only": False,
146146
"supports_rename": True,
147+
"supports_mtime": True,
147148
"thread_safe": True,
148149
"unicode_paths": os.path.supports_unicode_filenames,
149150
"virtual": False,

0 commit comments

Comments
 (0)