In MySQL there’s this nice thing - “temporary tables”, you create a table with the session’s scope and you don’t have to clean it when you’re done.
In the file system, there’s File::createTmpFile() which creates a regular file in the temporary folder.
So I have these questions about this issue:
- Is that acceptable for me not to delete those files, and hope the the user / OS will do that at some point?
- If I should clean after me, should I take care for those cases in which my app crashes before cleanup ?
- Is there any way to really create files with a process scope?