filesystem_spec icon indicating copy to clipboard operation
filesystem_spec copied to clipboard

new fs: dict of file objects

Open majidaldo opened this issue 3 years ago • 7 comments

Similar to MemoryFilesystem, opposite of get_mapper.

The use case is to compose (not layer) a 'global' fs where keys are arbitrary and file objects are also arbitrary.

majidaldo avatar Dec 06 '21 16:12 majidaldo

Would you mind providing a little more detail on the API you'd like to see? Is this something you are planning to work on or just want feedback, or a feature you would like to see developed for the library (by others)?

martindurant avatar Dec 06 '21 16:12 martindurant

Would you mind providing a little more detail on the API you'd like to see? Is this something you are planning to work on or just want feedback, or a feature you would like to see developed for the library (by others)?

For now it's just an idea. I've ran into situations where I might be working with more than one fs and just want to put it together (much like you would with a real fs). Another might be to handle situations where you have nested fs (like rar in rar). The constructor should take an arbitrary number of maps (nestedkeys or slashedkeys: file obj) and give back a fsspec object.

majidaldo avatar Dec 06 '21 18:12 majidaldo

I'm not really following how this would work from the user's point of view. You want a filesystem which "mounts" other filesystems?

martindurant avatar Dec 06 '21 19:12 martindurant

I'm not really following how this would work from the user's point of view. You want a filesystem which "mounts" other filesystems?

from fs point of view, yes.

majidaldo avatar Dec 07 '21 00:12 majidaldo

I would appreciate an example of how you would use this is code

martindurant avatar Dec 07 '21 13:12 martindurant

I would appreciate an example of how you would use this is code

I don't think the api is much more than fssspec.compose(fs1, fs2, ...) where some kind of precedence can be established from the argument order to resolve path conflicts.

majidaldo avatar Dec 11 '21 23:12 majidaldo

I think the work in #828 might cover what you want. I don't see a need for a filesystem of filesystems beyond that, unless you can make a compelling case.

martindurant avatar Dec 13 '21 14:12 martindurant