Is it good way to use /tmp in application for storing temporary files?

355 Views Asked by At

In my application, we store temporary images generated from PDF in /tmp/pdf_images folder. Is it a standard practice? Or It's not recommended to use of /tmp from application code?

1

There are 1 best solutions below

0
On

Assuming you're on linux or MacOS, this directory is just there for this.

Be sure to have them automatically deleted at closing of your application.

And note that they may be purged by the OS or the user (directly or not) at any moment when your application isn't running. And generally, it's totally cleaned at reboot (and every 3 days on MacOS).