You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The specific keys, or perhaps a FileInfo class, or similar, is TBD, but must be consistent across implementations. Must include:
I don't really understand the comment. "is TBD, but must be consistent across implementations" is an oxymoron. How can it be consistent between implementations when it is not specified yet? In order to increase the usefulness of the filesystem_spec API, this should be specified, imo.
Consider for example this:
importpprinto=fsspec.open("ssh://127.0.0.1")
ol=fsspec.open("/")
print("Info of ssh:///bin")
pprint.pprint([xforxino.fs.listdir('/', detail=True) ifx['name'] =='/bin'][0])
print("Info of /bin")
pprint.pprint([xforxinol.fs.listdir('/', detail=True) ifx['name'] =='/bin'][0])
The SSH implementation returns type: 'link' while the local one returns type: 'other' and another islink key.
I need some reliable way to detect file/folder/link and also get the link target, which does not seem to be returned by either of these two implementations. I guess, this could be a separate issue?
The other implementations should also be tested. There is a nice comprehensive overview here. Code for all, but concrete examples are missing for some.
The text was updated successfully, but these errors were encountered:
all implementations should return a dict with at least keys name, size, type.
other keys are allowed and vary by backend
we would like to have more constancy between backends, such as what we name timestamps and how they are formatted, but this work has not yet been done. In order not to break existing usage, standard keys should be added and not conflict with existing ones unless already identical.
we wish to keep open the possibility of formalising the structure returned by ls/info, but nothing has been done in that regard yet.
The HTTP file system is also inconsistent in regards to requiring the full URL specification for each listdir, open, etc. call. This is in stark contrast to the other implementations. See ray-project/ray#26423
Furthermore, some implementations return the name with leading / (fsspec.implementations.ftp.FTPFileSystem, sshfs.SSHF), some without (fsspec.implementations.git.GitFileSystem), which was another source of bugs for my wrapper. I am surprised that I have not encountered a filesystem yet that returns simply the file name just as the name key implies instead of the absolute path, but I still have 4+ other fsspec implementations that I still need to test and "implement" ...
The API specification for
listdir
and by inference alsoinfo
reads:I don't really understand the comment. "is TBD, but must be consistent across implementations" is an oxymoron. How can it be consistent between implementations when it is not specified yet? In order to increase the usefulness of the
filesystem_spec
API, this should be specified, imo.Consider for example this:
Output:
This is not consistent between these only two tested implementations:
mtime
is datetime in the SSH backend, but a float for the local interface. This is already mentioned in Add ctime/mtime to list of expected values in info #526, and probably should be a nanoseconds integer.type: 'link'
while the local one returnstype: 'other'
and anotherislink
key.The other implementations should also be tested.There is a nice comprehensive overview here. Code for all, but concrete examples are missing for some.The text was updated successfully, but these errors were encountered: