File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 50
50
if TYPE_CHECKING :
51
51
import sys
52
52
from collections .abc import Coroutine , Iterable
53
+ from datetime import datetime
53
54
from typing import Any
54
55
55
56
from obstore import Attributes , Bytes , ReadableFile , WritableFile
@@ -591,6 +592,13 @@ def _open(
591
592
592
593
return BufferedFile (self , path , mode , ** kwargs )
593
594
595
+ def modified (self , path : str ) -> datetime :
596
+ """Return the modified timestamp of a file as a `datetime.datetime`."""
597
+ bucket , path_no_bucket = self ._split_path (path )
598
+ store = self ._construct_store (bucket )
599
+ head = obs .head (store , path_no_bucket )
600
+ return head ["last_modified" ]
601
+
594
602
595
603
class BufferedFile (fsspec .spec .AbstractBufferedFile ):
596
604
"""A buffered readable or writable file.
You can’t perform that action at this time.
0 commit comments