ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 10 Dec 2019 05:30:32 +0100How to change the prefix to SAGE_TMP?https://ask.sagemath.org/question/26176/how-to-change-the-prefix-to-sage_tmp/`SAGE_TMP` looks something like this by default: `/tmp/tmpGMP2PR`. My /tmp is full but I have plenty of space in a different tmp directory on another disk. How can I change the default prefix in `SAGE_TMP` from `/tmp` to, say, `/raid/scratch`?
Thanks.Fri, 13 Mar 2015 23:42:18 +0100https://ask.sagemath.org/question/26176/how-to-change-the-prefix-to-sage_tmp/Comment by ikol for <p><code>SAGE_TMP</code> looks something like this by default: <code>/tmp/tmpGMP2PR</code>. My /tmp is full but I have plenty of space in a different tmp directory on another disk. How can I change the default prefix in <code>SAGE_TMP</code> from <code>/tmp</code> to, say, <code>/raid/scratch</code>?</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/26176/how-to-change-the-prefix-to-sage_tmp/?comment=26222#post-id-26222I am using v6.4.1.`~/.sage/temp/` is different. If I run a Notebook session, its files are stored under `~/.sage/notebook/...` but while a Sage calculation is running all the files there are just links to `/tmp/something` where `/tmp/something` is the value of `SAGE_TMP` in that session. I am saving large objects via the `save()` command and that's where I have the problem, because they can't fit in `/tmp`. There has got to be a way in Sage to set the prefix for SAGE_TMP from `/tmp` to something else.Tue, 17 Mar 2015 17:33:14 +0100https://ask.sagemath.org/question/26176/how-to-change-the-prefix-to-sage_tmp/?comment=26222#post-id-26222Comment by vdelecroix for <p><code>SAGE_TMP</code> looks something like this by default: <code>/tmp/tmpGMP2PR</code>. My /tmp is full but I have plenty of space in a different tmp directory on another disk. How can I change the default prefix in <code>SAGE_TMP</code> from <code>/tmp</code> to, say, <code>/raid/scratch</code>?</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/26176/how-to-change-the-prefix-to-sage_tmp/?comment=26186#post-id-26186Which version of Sage are you using? For me the temporary directory is in home/.sage/temp/... This is what you can see from
sage: from sage.misc.misc import SAGE_TMP
sage: SAGE_TMP
'/home/..../.sage/temp/...'
On the other hand, if you are using the Sage notebook it does also uses some temporary directory which is I guess in **/tmp/** by default.Sat, 14 Mar 2015 09:56:46 +0100https://ask.sagemath.org/question/26176/how-to-change-the-prefix-to-sage_tmp/?comment=26186#post-id-26186Answer by William Stein2 for <p><code>SAGE_TMP</code> looks something like this by default: <code>/tmp/tmpGMP2PR</code>. My /tmp is full but I have plenty of space in a different tmp directory on another disk. How can I change the default prefix in <code>SAGE_TMP</code> from <code>/tmp</code> to, say, <code>/raid/scratch</code>?</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/26176/how-to-change-the-prefix-to-sage_tmp/?answer=48983#post-id-48983There is no way to customize just SAGE_TMP, though you can customize ~/.sage by setting DOT_SAGE. You can see from the source code at https://github.com/sagemath/sage/blob/master/src/sage/misc/misc.py#L225 that SAGE_TMP is hardcoded as a function of the hostname and pid. I vaguely recall writing this code 13 years ago to avoid conflicts when running multiple copies of Sage. It seems pretty annoying now, and it could easily lead to ~/.sage/temp getting really big if Sage keeps crashing, whereas often /tmp on systems gets automatically cleaned up (at least on reboot). Also, /tmp is often on a much faster filesystem than ~/.sage (which might be mounted over NFS). Sigh. I hope somebody changes this.Tue, 10 Dec 2019 05:30:32 +0100https://ask.sagemath.org/question/26176/how-to-change-the-prefix-to-sage_tmp/?answer=48983#post-id-48983