Commit 4e27be18 authored by WeidenthalerMatthias's avatar WeidenthalerMatthias Committed by 戚攀
Browse files

Merge pull request !2 from WeidenthalerMatthias/feature.info

parents 3891ad2c 8484c28e
......@@ -47,6 +47,9 @@ s3_fs.get('s3://csst-prod/gaia/test/requirements.txt', 'requirements.txt', s3_op
# folder
s3_fs.get('s3://csst-prod/gaia/data', './', recursive=True)
s3_fs.get('s3://csst-prod/gaia/data', './', s3_options=s3_options, recursive=True)
# get file or folder info
s3_fs.info('s3://csst-prod/gaia/data')
s3_fs.info('s3://csst-prod/gaia/test/requirements.txt', s3_options=s3_options)
```
## astropy直接读写s3的写法适配
......
......@@ -7,4 +7,8 @@ def put(lpath, rpath, recursive=False, callback=fsspec.callbacks.DEFAULT_CALLBAC
def get(rpath, lpath, recursive=False, callback=fsspec.callbacks.DEFAULT_CALLBACK, maxdepth=None, s3_options=load_s3_options(), **kwargs,):
s3_fs = fsspec.filesystem('s3', **s3_options)
s3_fs.get(rpath, lpath, recursive, callback, maxdepth, **kwargs)
\ No newline at end of file
s3_fs.get(rpath, lpath, recursive, callback, maxdepth, **kwargs)
def info(path, bucket=None, key=None, refresh=False, version_id=None, s3_options=load_s3_options()) -> dict:
s3_fs = fsspec.filesystem('s3', **s3_options)
return s3_fs.info(path, bucket, key, refresh, version_id)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment