Temporary Files (GNAT User’s Guide for Native Platforms)

#### 7.4.4 Temporary Files ¶

You can control where temporary files get created by setting the `TMP` environment variable. The file will be created:

- Under the directory pointed to by the `TMP` environment variable if this directory exists.
- Under `c:\temp`, if the `TMP` environment variable is not set (or not pointing to a directory) and if this directory exists.
- Under the current working directory otherwise.

This allows you to determine exactly where the temporary file will be created. This is particularly useful in networked environments where you may not have write access to some directories.