Skip to content

Temporary File/Directory

Overview

Usecase

  • Download resource in temporary folder

How it work

It depend on

Linux | Window

-> C://temp

/tmp/...

C:///temp/

The order of search:

Python searches a standard list of directories to find one which the calling user can create files in. The list is:

The directory named by the TMPDIR environment variable.

The directory named by the TEMP environment variable.

The directory named by the TMP environment variable.

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.

As a last resort, the current working directory.

Other alternative

Example usecase

Reference