Temporary Files
Temporary files, as the name implies, are files that are used by a program as it is running and then are not useful once the program goes away. Unix systems typically store temp files in a well known location so that people know where to clean out files that are left over accidentally. Some systems will clear out the directory that holds the temp files on startup.
A program needs a unique name when it wants to create temporary file so that it does not clash with another file already in the temp directory. If two programs ended up using the same temporary file, one or the other would probably fail in weird and wonderful ways.
Where is this temporary directory? There are a number of calls available for finding a temporary directory ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access