Le_fs_* seems broken

So instead of using the standard linux open(), write(), close() we have to use le_fs_Open(), le_fs_Write(), le_fs_Close().

They aren’t working though. le_fs_Open() will return a file descriptor, but write will not write to files. I’ve given my application permission to access the parent directories in the .adef. Any help is appreciated.

Why don’t you use standard linux api if it is working fine?

Standard linux calls aren’t working. R13, legato 19.11.2 and 20.04.0

How about fopen(), fread() ???

I rewrote with fopen(), and it fails.

Other user does not find problem, you can have a look here:

open(), etc. are working for me.
Firmware Version: SWI9X06Y_02.35.02.00 5208b3 jenkins 2020/06/10 00:30:12.
Legato Version: 19.11.2_625c7d1acfd1ca45b2dbe189b4cb1ce7_modified

If your application is sandboxed, you won’t have access to much of the file system. If you unsandbox your application (by adding a line “sandboxed: false” to your .adef file), then you’ll have access to all of the file system. It doesn’t matter whether you use fopen() or open(). They should both work.

Of course, it’s better to run sandboxed. There are some features in the Component.cdef and .adef files that allow you to remain sandboxed but still have access to certain files in the root file system (see requires:). Sometimes that can not work as expected, though, because the file must exist when your app starts, and some files, like /etc/resolv.conf may get created later, or deleted and re-created as things happen at run time.

Another option is to build a small, simple, unsandboxed app that does the file system access and exports an application specific API for use by your main application code, which remains sandboxed.

I hope this helps.

–Jen