Not able to read/write anything in appsWriteable

Has anyone read/written any file in apps sandbox? I need help. I am not able to write anything in appswriteable under my app. it is showing me path is not correct. What should I do?

Have you tried to compile by using fopen() and fwrite() to create a file inside sandboxed application?

my app name is RR

#include “legato.h”

COMPONENT_INIT

{

LE_INFO(“** File write and read test **”);

FILE * fd;

char buf[] = “Hello Sierra…\n”;

fd = fopen (“test.txt”, “w”);

fwrite (buf, sizeof(char), sizeof(buf), fd);

fclose (fd);

fd = fopen (“test.txt”, “r”);

fread(buf, sizeof(char), sizeof(buf), fd);

LE_INFO(“Data read from the file is ==> %s”,buf);

fclose (fd);

}

Above code is working for me and it is creating and reading a text.txt file which is inside /legato/systems/current/appsWriteable/RR

But i want to paste my 4 private key files in app sandbox and later on encrypt them by accessing them through the app so i am not sure where exactly should I keep these files so that these are accesible through my app?

You can use bundle in adef file

Here is an example to bundle audio file

After that you can use fread() to read the content

Bundle is working fine for me. but is it possible to create the folder ‘USER’ with ssh root in my app (SecStore) directory after app is flashed in mangOH yellow

like below, USER folder added after app is flashed in mangOH yellow

/legato/systems/current/appsWriteable/SecStore/**USER
**

because when I create USER manually after flashing the app then my source code does not recognize this path and USER folder.

Question : when I manually create a folder in /legato/systems/current/appsWriteable/SecStore/
then is it going outside sandbox and hence my app code does not find this path?

no, i don’t think so

for sandboxed application, probably you need to create the required folder during adef in bundle section