Skip to content

tokio::fs::File::from_std() assumes current file position is zero #6374

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

Closed
allada opened this issue Mar 3, 2024 · 0 comments · Fixed by #7366
Closed

tokio::fs::File::from_std() assumes current file position is zero #6374

allada opened this issue Mar 3, 2024 · 0 comments · Fixed by #7366
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-fs Module: tokio/fs

Comments

@allada
Copy link

allada commented Mar 3, 2024

Version
1.36.0

Platform
Any

Description
tokio::fs::File::from_std() assumes the file being passed in's position is zero even if the StdFile has a different seek position.

This can cause AsyncSeek<File>::poll_complete() to return the wrong file position which causes wrong behavior when using .seek().

See:
https://docs.rs/tokio/latest/src/tokio/fs/file.rs.html#242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-fs Module: tokio/fs
Projects
None yet
2 participants