I have these two objects:
- s3://my-bucket/some/prefix (an object key exactly equal to the “directory” name)
- s3://my-bucket/some/prefix/file.txt (an object under that prefix)
Then:
from s3fs import S3FileSystem
fs = S3FileSystem()
print(fs.isfile('det-study-a/some/prefix/')) # True
print(fs.isdir('det-study-a/some/prefix/')) # True
print(fs.isfile('det-study-a/some/prefix/')) # False
print(fs.isdir('det-study-a/some/prefix/')) # True
Environment
- s3fs version: 2025.12.0
- Python: 3.12