GeoEco.DataManagement.Directories.Directory.CreateTemporaryDirectory

classmethod Directory.CreateTemporaryDirectory()

Creates a directory suitable for holding temporary files.

The directory’s path will take the form parentDirectory/GeoEcoTemp/randomName (On Windows computers, backslashes will be used instead of forward slashes.) parentDirectory will be one of the following locations (the first one that is found to exist):

  1. The ArcGIS geoprocessor’s arcpy.env.ScratchWorkspace if it has been set to something.

  2. The directory named by the TMPDIR environment variable.

  3. The directory named by the TEMP environment variable.

  4. The directory named by the TMP environment variable.

  5. A platform-specific location: - On Windows, the directories C:\TEMP, C:\TMP, \TEMP, and \TMP, in that order. - On all other platforms, the directories /tmp, /var/tmp, and /usr/tmp, in that order.

  6. As a last resort, the current working directory of the process hosting the Python interpreter.

randomName will be a random, non-existing name beginning with tmp.

You must manually delete the temporary directory when you are finished using it. (It will not be automatically deleted for you.)

Returns:

Path of the newly-created temporary directory.

Return type:

str