vterron / lemon

Differential photometry for humans (and astronomers)
64 stars 21 forks source link

Temp Folder Location #87

Closed sengle01 closed 8 years ago

sengle01 commented 8 years ago

Hello,

Here's what I'm assuming would be an easy one, but in looking over some of the routines, I didn't readily see an option for it. How would I go about changing the location of the temp folder used by Lemon?

Best, Scott

vterron commented 8 years ago

The location of the temporary folders is determined in Python by a global variable: tempfile.tempdir. LEMON does not set it, so all the functions of the tempfile module search a standard list of directories and set the temporary directory to the first one in which the user can create files. The list is:

  1. The directory named by the TMPDIR environment variable.
  2. The directory named by the TEMP environment variable.
  3. The directory named by the TMP environment variable.
  4. A platform-specific location:
    • On RiscOS, the directory named by the Wimp$ScrapDir environment variable.
    • 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.
  5. As a last resort, the current working directory.

Thus, you could add something like this line to your .bashrc file:

export TMPDIR=/data/tmp/

sengle01 commented 8 years ago

Oh perfect. Thank you so much for the quick response.

Best, Scott