Temporary and Other Files KDE Uses

Temporary and Other Files KDE Uses

In KDE 3.0 there is share/cache which contains cached information, like the http cache and cached favicons. If you need diskspace you can throw away files from there.

Since KDE 2.x already there is also tmp-HOSTNAME and socket-HOSTNAME. These are a bit special. tmp-HOSTNAME is used for temporary files. socket-HOSTNAME is used for sockets. Normally these two dirs are symlinks to /tmp/kde-USER and /tmp/ksocket-USER respectively.

The program lnusertemp creates these symlinks if these directories do not yet exist. Calling lnusertemp tmp creates the tmp-HOSTNAME symlink, while lnusertemp socket creates the socket-HOSTNAME symlink.

If you want to use other locations you can replace the lnusertemp executable with your own script or make sure to create the symlinks yourself from the startkde script. If tmp-HOSTNAME or socket-HOSTNAME is a valid directory or a symlink to a valid directory they will be left untouched by lnusertemp. Valid means that the directory should exist and that the directory should be owned by the user.

The socket-HOSTNAME directory should always point to a directory on a local filesystem since otherwise sockets may not work. Sockets should not be deleted from this directory while a KDE session is active because it may cause problems (Typically you will no longer be able to launch any apps and will get errors like Can't talk to klauncher.)

The tmp-HOSTNAME directory should preferably be on a local filesystem because that is fastest, but it can be on a remote filesystem too. It will always contain the file ksycoca, you must not delete this file while a KDE session is active. If you do you can regenerate it by running kbuildsycoca from within the KDE session.

Some operating systems clear the /tmp dir when booting, this means that the ksycoca file needs to be regenerated when you start up KDE. You can speed up the start of KDE by ensuring that ksycoca files are not deleted during the boot-process. On the other hand, when you run computers that are used by a large number of users and have a limited /tmp space, you may wish to remove these files more often, e.g. after a user logs out. The end of the startkde script could be a good place to do so.

KDE Logo