Giter Site home page Giter Site logo

Behaviour of `ls` about s3fs HOT 4 CLOSED

fsspec avatar fsspec commented on August 11, 2024
Behaviour of `ls`

from s3fs.

Comments (4)

mrocklin avatar mrocklin commented on August 11, 2024

I think so? I don't know that I have enough experience with S3 to be sure. What are your thoughts?

from s3fs.

martindurant avatar martindurant commented on August 11, 2024

I will think about this for the evening. I did a little trial and error and am not really happy with the various combinations.
There are additional complexities, such as 'bucket/dir' and 'bucket/dir/' both being valid keys with or without data, with or without content at 'bucket/dir/stuff'.

from s3fs.

martindurant avatar martindurant commented on August 11, 2024

Let me step back and describe a simpler ls that more closely reflects the workings of S3 (which has no real directories, only paths that happen to contain/). What if we go back to a flat structure, allowing arbitrary filenames?

ls('') -> list of buckets
ls('mybucket') -> all keys in bucket, or notfound if bucket inaccessible
ls('mybucket/myfile') -> one exact match or notfound
info('mybucket/myfile') == ls('mybucket/myfile', detail=True)

mkdir('bucket') -> creates bucket
mkdir('bucket/path') -> notimplemented, or no-op (choice)

walk("") -> all keys in all buckets accessed so far
walk(path) -> all keys that startwith path

glob(pattern) -> normal match, the only one here where '/' has significance within buckets

In short, distributed.s3 would use walk or glob, not ls in this scheme.

from s3fs.

mrocklin avatar mrocklin commented on August 11, 2024

This seems like a straightforward approach that is easy to understand, implement, and convey to users.

I can see wanting to change it at some point in the future to impose a more traditional directory structure. But I can also imagine not wanting to change it, depending on how people use S3. Regardless there are probably higher priority things.

from s3fs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.