The XDG Base Directory Specification is a very interesting spec for user directories. It also provides good default values, except for XDG_RUNTIME_DIR
.
Now I am writing a software that needs to create named pipes. It is a per-user client-server framework (there is a FIFO for the server and a FIFO per client).
If XDG_RUNTIME_DIR
is not defined, I am currently using a per-user subdirectory in /tmp
— but it does not ensure all the specified conditions (viz. the paragraph starting with "The lifetime of the directory MUST be bound to the user being logged in…")
Is /tmp/myserver-$USER
good enough?
Edit
I saw elsewhere a few suggestions:
.
is quite unsatisfactory (at least because it is not an absolute path).- I also saw
/var/run/user/$USER
— not bad, but that directory does not exist (at least on my box running a Debian testing)