We briefly mentioned that temporary files can reside inside the /tmp directory. Often, /tmp is home to short lived files such as lock files or information that can be volatile (destroyed on a power event without any detriment to the system). It is also usually RAM-based, which can offer performance benefits as well, especially if used as part of an inter-process communication system (more on this later in another recipe).
However, it is important to know that other programs can access your file in /tmp, so it should be secured with the sufficient permissions. It should also be given a name that is suitably random so that a filename collision does not occur.