:create suffix only creates dirs
For --filesystem=FS option, ":create suffix indicates that the location will be read-write and created if it doesn't exist".
If it doesn't exist, it will always be treated as directory, and created as such. There is no way to point that last part of the created location should be a file.
Does it really make sense to create a file without giving it any content?
@matthiasclasen I think yes, because otherwise you can't bind mount a file if it doesn't exist
This is required to for https://flathub.org/apps/details/com.hamrick.VueScan . The application creates a file ~/.vuescanrc during runtime.
The author has currently no roadmap to move this file (~/.vuescanrc ) with registration information to ~/.vuescan/vuescanrc .
From https://github.com/flathub/com.hamrick.VueScan/blob/master/com.hamrick.VueScan.yaml
$ vi com.hamrick.VueScan.yaml
...
finish-args:
# The aurhor has no roadmap to move the rc file to ~/.vuescan/vuescanrc
# An empty file needs to be created before the first run with the command below
# $ touch ~/.vuescanrc
- --filesystem=~/.vuescanrc # License file
- --persist=.vuescan
I would suggest to patch the app. It should not look at either ~/.vuescanrc or ~/.vuescan/vuescanrc but at $XDG_CONFIG_HOME/vuescanrc
Most of the bad behaving apps are proprietary.
Regarding vuescan this is probably fine: https://github.com/flathub/com.hamrick.VueScan/pull/1
@TingPing This does not help, if the file ( ~/.vuescanrc) does not exist.
Either
- flatpak will need to create an empty file ( recommended)
- or, Alternatively, one can pass "--env=HOME=~/.vuescan/" to workaround this issue ( comes with other sets of issues)
@matthiasclasen proprietary application. The author has no plans to update this behaviour.
Yes, I had to revert https://github.com/flathub/com.hamrick.VueScan/pull/1 since it created an empty directory named .vuescanrc when actually, an empty file is needed instead.
The current manifest doesn't actually work as intended either, because the user needs to create the empty file manually at ~/.vuescanrc since :create and such always assumes folders are to be created.
Next question here is how to do this compatibly.
We may have to add a new :create-file suffix, since existing users wille expect that :create always creates a directory
Should this be --filesystem=~/vuescanrc:create-file or --persist=.vuescanrc:create-file ?
If persist could create a file, that would be preferable.
If persist could create a file, that would be preferable.
You are going backwards, --persist is to avoid escaping the sandbox and --filesystem is to escape the sandbox. The former should never need to create anything because the only reason :create exists is the technical detail of how bind mounts work pulling in data from outside the sandbox.
well, --persist bind mounts too, no ?
Hmm, I suppose it does, but clearly the filename doesn't have to exist ahead of time or else it would be useless. Would have to look into how that works.