Project

General

Profile

Bug #12417

Snapshot files name clash when multiple users use darktable (/tmp/dt_snapshot_$i.png)

Added by Matthieu Moy 20 days ago. Updated 20 days ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Darkroom
Target version:
-
Start date:
11/22/2018
Due date:
% Done:

0%

Affected Version:
git master branch
System:
Ubuntu
bitness:
64-bit
hardware architecture:
amd64/x86

Description

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).

History

#1 Updated by dar ix 20 days ago

they could probably be in .cache/darktable/ instead of /tmp/

#2 Updated by Matthieu Moy 20 days ago

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).

#3 Updated by Pascal Obry 20 days ago

So we probably just want to add the process id in the name, something like : /tmp/dt_$pid_snapshot_$i.png

#4 Updated by Matthieu Moy 20 days ago

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 PDF