Zephyr fopen() working in native posix application #81079
Replies: 2 comments 1 reply
-
Hi @Dharshini-user! We appreciate you submitting your first issue for our open-source project. 🌟 Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙 |
Beta Was this translation helpful? Give feedback.
-
@Dharshini-user If you forget to enable the needed components when building for a real HW target, the linking will instead just fail telling you fopen() does not exist. If you really want to use |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I am Trying to build a Zephyr application as a native POSIX application, which has to run in WSL based Linux environment .My application involves making littlefs file mount,opening a file using fopen() ,writing hello into and closing the file.The application will use the text file thus created for some processing. The compilation is successful and the execution is not successful.
During execution lfs file mount is successful
case1: if path is /lfs/file_name.txt, then fopen fails stating that there is no such file or directory.
Case2: if path is just file_name.txt, then fopen opens a file in the Linux directory from where I run the Zephyr executable.
So I would like to know
2.How to make fopen() work for lfs mounts?
3.Suppose if I build the same application for a hardware and load it to the hardware board.Then in that case , my application will be able to use only lfs file mount structures right? So, based on the above working scenario,fopen cannot work with lfs file mounts and here we don't have a host file ( similar to Linux file system during Posix builds) system.How file access and operations could be made possible in this hardware case, using fopen?
Thanks in advance.
Best regards,
Dharshini S
Beta Was this translation helpful? Give feedback.
All reactions