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

Consider supplementing getFile with downloadFile in VFS module #16

Open
benquarmby opened this issue Sep 23, 2016 · 2 comments
Open

Consider supplementing getFile with downloadFile in VFS module #16

benquarmby opened this issue Sep 23, 2016 · 2 comments

Comments

@benquarmby
Copy link
Collaborator

Currently the vfs.getFile method returns the body of a file as a raw argument. This is fine for small text files, but less optimal for binary files. It's also a different behavior to the dump and zip modules that pipe responses to a write stream.

I recommend adding a vfs.downloadFile method.

@itsananderson
Copy link
Owner

Would downloadFile return a stream, or would it take a file path and write the file directly to that path? I think having an API for both would be useful. Maybe readFile would give you a stream, downloadFile would take a path to write to, and getFile would work like it does today?

@benquarmby
Copy link
Collaborator Author

I think vfs.downloadFile should behave the same as dump.download and zip.download, which is to write to a specified file path. A readFile method that provides a stream makes sense too. Perhaps zip and dump should follow suit?

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

No branches or pull requests

2 participants