Can I discard temp/.tmp directories?

In my user directory the temp directory contains 139 directories labelled •luNNxxxxxx.tmp•

  1. Why do these exist?
    2)What happens if I discard them?

Most non-trivial programs have to use some temporary (internal) files while working. It is so common need, that every operating system provides a dedicated temporary directory for that; Windows has two such directories (one system, and one-per-user user’s temp directory). LibreOffice is not an exception; to avoid clutter, it creates a sub-directory in the temp directory, starting with lu and the current process id, and possibly a sequence number after it; and then puts its temporary files there. This directory gets deleted by LibreOffice process during its cleanup when it exits cleanly.

Unfortunately, this doesn’t always happen. LibreOffice might crash (and then its proper cleanup procedure won’t run); or the files in the temp directory could be locked by other processes (e.g., mailing files can create temporary copies there, to pass to the mailer; if the mail composition takes longer, and LibreOffice gets closed before mail is sent, the temporary files could be still locked by the mailer program. Another possibility is an antivirus temporarily blocking the files scanning them, while LibreOffice tries to cleanup).

This creates lingering temporary files left after LibreOffice exits. On systems where temp directories get cleaned up upon restart, like many Linux systems, this usually doesn’t hurt. On Windows, this may pile up over time to hundreds such directories. Note that the specific naming of the directories make it easier to see what belongs to LibreOffice; and using subdirectories makes it easier to manage - otherwise, it could be tens of thousands individual files, not hundreds directories - and sometimes, operating system’s file operations take much longer in directories containing such large amount of files.

You can safely discard them, making sure first that LibreOffice process isn’t running (including quicklaunch). Discarding them while the program is running might prevent currently running program from proper execution, and cause crashes or data loss (temporary files are created during execution for a purpose - otherwise they wouldn’t be created in the first place).

1 Like