Read/Write App Data In HKPG

Ported packages mostly use the layout done by the system, eg using bindir,libdir, datadir … on linux for instance --datadir resolves to /usr/local/share, in Haiku this would be /boot/system/data (when using some kind of build system), hardcoded paths can cause problems.

Packages are RO images that get mounted onto arbitrary paths, /system is one example path packages get mounted onto. But any chosen user directory is valid and the paths for the config can vary based on this if wantef.

The working directory is independant, not sure what your question is about for it.

Interesting, Do you have any links to documentation on activating apps into different directories?

Working directory changes depending on where the app is launched from. Launch it through Deskbar, Tracker, etc and it’s ~. Launch it from the terminal i.e. ./appname and the working directory is that folder. Does changing the app activation folder, change this behavior?

There are only two that are easily used: /system (for system wide packages) and /boot/home/config (for packages only available to a single user). Since there is no complete multi-user support, the distinction is a bit useless, and this does not get a lot of testing.

It is possible to set up your own packagefs mountpoints in different places, for example haikuporter uses this to build a chroot with a specific set of packages (listed in the recipe) activated inside it. But there isn’t much documentation, your best hope if you want to do this is to read haikuporter sourcecode.

No, why would it?

1 Like