Closed bugadani closed 2 years ago
Hey @bugadani, thanks for your patience! I think I've tracked this down to another mismatch of structs on the C side and rust side.
The files are created, and when you step into the ReadDir
Iterator, if you look carefully the entries are being populated; with one problem. A zeroed field not included in the C side happens to overlap with the start of the name field, meaning the name on the Rust side starts with a null pointer... hence why only the root directory is printed!
I need to track down whether this is an issue with rust-lang/libc or the newlib component of esp-idf.
This is an esp-idf issue, specifically this definition.
d_ino
should be type ino_t
, but its defined as an int
. sizeof(int) == 4, sizeof(ino_t) == 2
on the esp-idf platform, hence this failure. I'll submit a fix asap :).
The final part Err(Os { code: 5, kind: Uncategorized, message: "I/O error" })
was yet another issue; this time with spiffs. The spiffs module can emit SPIFFS_VIS_END
, even though this is not a publically documented error code. According to the developer it is not an error, and should not be emitted.
I've now submitted the two patches internally. Hopefully, they'll be merged and backported soon :).
Awesome, thanks :)
Thanks for the report @bugadani. This is now fixed & backported to V4.4, so I'm closing this issue :). You may need to remove .embuild/
and rebuild to pull in the fixes from the v4.4 branch.
Given is the following test code, built on a CMake setup (with some details omitted):
I expect the following output:
Instead, the output I get is the following:
The OS error is unrelated (SPIFFS seems to indicate the end of folder iteration by returning a value that gets turned into EIO), but note that the path in the DirEntry has an empty filename.
This issue is present on: