My application reads/writes data on an SD card with multiple subdirectories.
This works if I (pre)make the directories manually, I.E. outside of a Legato application from the command line, but not when using le_dir_MakePath, le_dir_Make or even mkdir.
Note that the application is currently running un-sandboxed. The SD card has been mounted at /mnt/userrw/sd - the /sd dir was also premade, manually.
Ultimately, the system (modem) should be capable of mounting and setting up the directory structure from within a Legato application.
I think I’ve sorted it out by adding the following to my .adef file:
requires:
{
dir:
{
// The SD card is mounted at '/mnt/userrw'
/mnt/userrw /
}
}
Note that this particular app doesn’t do the mounting - only reading and writing. In another app’s .adef I have:
requires:
{
device:
{
// Request read and write access to the SD card.
[rw] /dev/mmcblk0p1 /dev/mmcblk0p1
}
...
}
Did you have issues running your app(s) sandboxed?
I get the following error when running the app as sandboxed. LE_FILENAME dir_MakeSmack() 42 | Could not create directory '/mnt/userrw'. Permission denied
Also, do you mind sharing where you mounted your SD card? Is there perhaps a ‘better’ directory?