Storing data in file under /home/root (Permission denied)

Hello!

I’m having problem storing data in a file under the /home/root directory from my application. In my .adef I have:

requires: {
file: {
/home/root/data.txt /
}
}

And in my cdef I have:

requires: {
component: {

    onTargetOracleJvm
}
file: {
		/home/root/data.txt /
} 

}

I can easily read data from the file but storing data there is another matter… The idea is to store data in the file by one application at one time to be read by another application at another time. When i try to do this I get a “data.txt (Permission denied)”.

How do I store data in a file on the device filesystem?

Hi

“/home/root” should be reserved for “root” user.
By default Legato apps are sandboxed, so they don’t have root privilege.
From Legato documentation:
https://docs.legato.io/latest/defFilesAdef.html#defFilesAdef_requiresFile

Note
Even though the file system object appears in the app’s sandbox it still needs permissions settings on the file. File permissions (both DAC and MAC) and ownership (group and user) on the original file in the target system remain in effect inside the sandbox.

Jay