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

Bad writing data method used in File::write_at_sync #190

Closed
ikopylov opened this issue Aug 31, 2022 · 1 comment · Fixed by #211
Closed

Bad writing data method used in File::write_at_sync #190

ikopylov opened this issue Aug 31, 2022 · 1 comment · Fixed by #211
Assignees
Labels
bug Something isn't working

Comments

@ikopylov
Copy link
Member

It uses write_at which does not guarantee that all passed data will be written. Instead write_all_at should be used (https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.write_all_at)

https://github.com/qoollo/pearl/blob/master/src/blob/file.rs#L96

@ikopylov
Copy link
Member Author

Same for read: read_at should be replaced with read_exact_at: https://github.com/qoollo/pearl/blob/master/src/blob/file.rs#L118

read_to_end should be used inside read_all: https://github.com/qoollo/pearl/blob/master/src/blob/file.rs#L101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants