Good default for XDG_RUNTIME_DIR?

Posted by cadrian on Server Fault See other posts from Server Fault or by cadrian
Published on 2012-05-14T11:35:12Z Indexed on 2014/06/01 3:29 UTC
Read the original article Hit count: 403

Filed under:
|
|

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)

© Server Fault or respective owner

Related posts about directory

Related posts about desktop