Anil
Anil

Reputation: 405

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

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?

Upvotes: 2

Views: 386

Answers (1)

Denys Séguret
Denys Séguret

Reputation: 382132

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).

Upvotes: 1

Related Questions