Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to disable globbing? #895

Open
polm-stability opened this issue Sep 11, 2024 · 3 comments
Open

Is it possible to disable globbing? #895

polm-stability opened this issue Sep 11, 2024 · 3 comments

Comments

@polm-stability
Copy link

I'm trying to copy files from s3 to a local system. The files were downloaded from a variety of sources and kept their original filenames, some of which seem to have included ** or other wildcard patterns. Is there a way to disable globbing or escape the filenames? I am using filenames directly as supplied by an s3fs ls call.

@martindurant
Copy link
Member

The top level user methods like cat expect to expand paths. However, there are other methods like cat_file that work one file at a time and don't expand.

Currently, only recursive= is passed on by the bulk functions to .expand_path. There has been talk of disabling or being able to configure this process more, but these is no such option right now.

@polm-stability
Copy link
Author

Thanks, get_file is exactly what I needed.

Maybe it would be good to mention this in the documentation? Something like adding "does not expand paths" to the get_file documentation, and something like "You can use get_file to get a single file" in the get documentation. Now that you've explained it it's a clear convention, but being new to the library I never would have realized it.

@martindurant
Copy link
Member

Updating docstring to make things clearer is always a good idea. Would you like to contribute an update? The change would be in fsspec.spec.AbstractFileSystem , which is S3FileSystem's superclass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants