Snapshot files name clash when multiple users use darktable (/tmp/dt_snapshot_$i.png)
git master branch
When creating a snapshot, dt creates a file named /tmp/dt_snapshot_$i.png, where $i is the number of the given snapshot.
When multiple users use dt on the same machine, the second user will try to create /tmp/dt_snapshot_1.png, which already exists, and the snapshot will fail.
Files should be named in a unique manner, eg. /tmp/$LOGNAME/dt_snapshot_$i.png or /tmp/dt_snapshot_$$_$i.png ($LOGNAME being the username, and $$ the PID of the darktable instance).
they could probably be in .cache/darktable/ instead of /tmp/
It's not really a cache: it won't ever be re-used. So /tmp is really the place where it should be IMHO (trashed on reboot, won't eat your diskspace if you forget to clean it).
So we probably just want to add the process id in the name, something like : /tmp/dt_$pid_snapshot_$i.png
This will work, yes.
I like when software create a directory in /tmp/ to avoid putting too many files without any hierarchy (e.g Firefox creating a /tmp/mozilla_$LOGNAME), but that's a separate and much less serious issue.
Also available in: Atom