Store Files Persistent; Cannot write to hardlinked folder?

Hi, I hardlink an external folder for my application, but I cannot access it.

.adef-File:
requires:{
dir:
{
[rw] /home/root/ar_extern /home/data
}
}

.cdef-File:
requires:{
dir:
{
[rw] /home/root/ar_extern /home/data
}
}

Original Folder is in /home/root/ar_extern
ls -lsa /home/root/
0 drwxr-xr-x 4 root root 376 Jun 19 14:08 .
0 drwxr-xr-x 3 root root 224 Jan 1 1970 …
4 -rw------- 1 root root 2536 Jun 19 15:02 .ash_history
0 drwxrwxrwx 2 root root 160 Jun 19 14:39 ar_extern
0 drwxr-xr-x 2 root root 384 Jun 19 12:20 backup_ar

Hard Link is properly created:
ls -lsa /legato/systems/current/appsWriteable/initTests/h
ome/
0 dr-x—r-x 3 root root 224 Jun 19 14:42 .
0 dr-x—rwx 10 root root 672 Jun 19 14:42 …
0 drwxrwxrwx 2 root root 160 Jun 19 14:39 data

As you can see, access rights are 777, so everyone should be able to do anything.

In SourceCode (.cpp) I tried the following paths:

  • home/data/ag_ids.json
  • /home/data/ag_ids.json
  • ./home/data/ag_ids.json

None of those created a file

The writeFile works, when writing to “ag_ids.json”, the file is created in the root folder.
Storing files in the root-Folder of the application /legato/system/current/appsWritable/initTests/ works but is removed whenever I reinstall my app. I need the file to be persistent

Any idea what I might do wrong or are there any further questions?

Legato Framework Version: 18.10.02

Thank you and best regards

Frank

Here says you can use unsandboxed application to create file

Thanks for the answer, but an unboxed application raises some potential threats for the system that I would like to avoid. That’s why I only want 1 shared folder.

Here suggests to create file outside sandbox and give app access to it in adef file,

Thanks jyijyi, I fixed it by creating a second app that is not sandboxed. Not perfect, but it works