-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fix object download to file #105
Conversation
The ObjectContent::to_file() function was not working properly, as it could not write in a temporary file (created with tokio::fs::File::open(), which opens a file in read-only mode). To solve this issue, modified the way temporary files are opened to be able to write inside of it.
@jeasai Thank you for providing this fix. I’ve taken the liberty of rebasing and updating the example to make it runnable without needing to place files in specific positions. I’ve committed the changes here: a7704fe. You can either rebase from my commit, and I’ll review your PR, or I can create a new PR (with you as the co-author) for my colleague to review. Let me know what works best for you! |
This new example demonstrates how to download an object and store its content into a file.
2dae6c4
to
b97b2f6
Compare
Hello @HJLebbink ! Thanks for your answer and the example update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f51f196
to
0568e5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What
Fixed
minio::s3::builders::object_content::ObjectContent::to_file()
(which tries to write in a file opened in read-only mode), and added an example to show how to use it.To reproduce the issue
main.rs:
Cargo.toml:
Returns: