I'm designing a GUI application that works with scanned documents. It allows the scans to be manipulated before they are saved/exported, so it needs to store the data for each scanned page temporarily while it is being worked on.
The amount of data is quite large (often over 100MB even with compression) so storing it in memory is not practical. It's also an onerous job scanning lots of pages, so the scans should be preserved in a "working area" on disk, so that even after rebooting the system the app can be reopened and the previously scanned data will be there ready to continue processing.
I am not quite sure where exactly I should be saving this important, but temporary, data:
/tmp/is bad, because the data should remain after exiting and reopening the app, and even remain after a reboot.
$HOME/.config/appname/isn't really correct, as it's not configuration data I'm saving.
$HOME/.local/share/isn't correct, as the XDG spec says this is for overriding things like icons that are stored in
/usr/share/and there would never be "global" scans put in
$HOME/.cacheis close, but this isn't cache data and the user would be most annoyed if it got deleted after they scanned 100 pages and had to scan everything all over again.
$HOME/.local/lib/appnamedoesn't appear in any specs, but could be ok if
.localmeans user-local (
/var/lib/use.) If it means local to the machine then it's not a good fit, because the user should be able to log in to a machine with a high-speed scanner, do their scans with this app, log out, then log in on a normal PC and open the app to see what they just scanned - i.e. the data should be preserved across the network on logout, and
~$HOME/.cacheneedn't be shared among machines so
$HOME/.localmay not be either - I'm not sure.
So any suggestions on where the most appropriate place to store this kind of data might be?
EDIT: Just to clarify, this is per-user data, and the application is run as a normal user, so putting it in
/var/ is probably not correct as you then have to handle multiple users running the application, aside from normal users not having write access there.