esp_littlefs
esp_littlefs copied to clipboard
feat(esp_littlefs): Support O_DIRECTORY for WAMR
@BrianPugh Although this opening flag may not be appropriate for littlefs, but some open source project based on GNU use this flag, so I hope esp_littlefs can support this.
@donghengqaz thanks for the PRs! Can you try rebasing both of your PRs on my latest push to master? CI wasn't working properly and I think I fixed it. This way we can easily see if it works across a variety of ESP-IDF versions. Thanks!
Im a bit confused on how this feature would work; lfs_file_open
fails and then you just set the flags
field. Can you explain and add a unit test? thanks!
@donghengqaz , any thoughts on this? Would love to merge your PRs
so @donghengqaz to merge this, I'm going to need a few things:
- Version guards since
O_DIRECTORY
only seems to be in >=v4.3
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
// Code Here
#endif
-
I'm going to need a unit test.
-
A bit of explanation on whats going on, I wouldn't expect this code to work.
Hi @BrianPugh, thanks for Continuous attention. I create this PR to let esp-littlefs can also work on WAMR(https://github.com/bytecodealliance/wasm-micro-runtime), and its internal functions call like 'fd = open(PATH, O_DIRECTORY | flags)', and openat(fd, path, flags)
.I talked with ESP-IDF's file-system maintainer in these days, and he plan to add openat
and other family functions later, so please keep this PR, and when ESP-IDF has done, I will modify this PR and add unit tests.
@BrianPugh I discuss with esp-idf team about this again, but they show it is hard for them to implement these APIs(like optnat
), so I plan to implement these APIs in application layer. For this I hope to add option O_DIRECTORY
support, and add features to get directory.
So this PR is needed, and I will implement F_GETPATH
, then add test case, do you agree with this ?
I think that sounds good to me! We will re-review once you believe its ready. Thank you!
@BrianPugh I push my code including unit test, PTAL.
I plan on releasing v1.6.0
with this change by the end of the weekend (after I fix up some of the tests a little more).
I plan on releasing
v1.6.0
with this change by the end of the weekend (after I fix up some of the tests a little more).
This is very help and I can use the v1.6.0
in https://components.espressif.com/components/joltwallet/littlefs.