-
Notifications
You must be signed in to change notification settings - Fork 38
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
File::metadata()?.len()
returns 0
#92
Comments
So it seems the underlying I think this needs to be implemented in esp-idf, or maybe we need to patch the std library to use |
I am slightly confused by the heap of |
Finally tracked this one down, it seems the definition for
Now to figure out which side is wrong, and what fields need to change. |
Correct the size of certain types on espidf platform This was initially discovered in esp-rs/rust#92, the reason stat fails on the esp-idf platform is because the `stat` struct has a different layout on the Rust side compared to the C side.
Correct the size of certain types on espidf platform This was initially discovered in esp-rs/rust#92, the reason stat fails on the esp-idf platform is because the `stat` struct has a different layout on the Rust side compared to the C side.
Correct the size of certain types on espidf platform This was initially discovered in esp-rs/rust#92, the reason stat fails on the esp-idf platform is because the `stat` struct has a different layout on the Rust side compared to the C side.
This has now been fixed in the esp-rs/rust 1.59.0.0.1 branch, upstream PR is pending. Compiler builds are being worked on but you are welcome to build the compiler yourself if you want to test this out! Thanks for your patience :) |
Thanks a lot, I'll give it a try as soon as I can :) |
I'm not sure where I should report issues that are either libc or std, so I hope this is either the right place or someone knows.
I'm trying to read the size of an open file. I have two options to do this:
fs::File::metadata()
The C impl looks like this:
I have the following snippet:
The C implementation returns the correct size (for example, 868 bytes), but the rust call gives me 0.
I'm using a fresh enough installation of esp-idf 4.3.1 and rust 1.56.0.1 [sic].
The text was updated successfully, but these errors were encountered: