prefer Unix standard-conformant $TMPDIR over hard-wired /tmp;
authorwenzelm
Thu, 09 Oct 2014 11:15:03 +0200
changeset 58639 1df53737c59b
parent 58638 5855b9b3d6a3
child 58640 37f852399a32
prefer Unix standard-conformant $TMPDIR over hard-wired /tmp;
etc/settings
lib/Tools/browser
lib/scripts/timestart.bash
src/Doc/System/Basics.thy
src/Pure/System/system_channel.scala
--- a/etc/settings	Thu Oct 09 11:00:15 2014 +0200
+++ b/etc/settings	Thu Oct 09 11:15:03 2014 +0200
@@ -65,7 +65,7 @@
 ISABELLE_TOOLS="$ISABELLE_HOME/lib/Tools"
 
 # Location for temporary files (should be on a local file system).
-ISABELLE_TMP_PREFIX="/tmp/isabelle-$USER"
+ISABELLE_TMP_PREFIX="${TMPDIR:-/tmp}/isabelle-$USER"
 
 # Heap input locations. ML system identifier is included in lookup.
 ISABELLE_PATH="$ISABELLE_HOME_USER/heaps:$ISABELLE_HOME/heaps"
--- a/lib/Tools/browser	Thu Oct 09 11:00:15 2014 +0200
+++ b/lib/Tools/browser	Thu Oct 09 11:15:03 2014 +0200
@@ -70,7 +70,7 @@
 classpath "$ISABELLE_HOME/lib/browser/GraphBrowser.jar"
 
 if [ -n "$GRAPHFILE" ]; then
-  PRIVATE_FILE="${ISABELLE_TMP:-/tmp}/$$"$(basename "$GRAPHFILE")
+  PRIVATE_FILE="${ISABELLE_TMP:-${TMPDIR:-/tmp}}/$$"$(basename "$GRAPHFILE")
   if [ -n "$CLEAN" ]; then
     mv -f "$GRAPHFILE" "$PRIVATE_FILE" || fail "Cannot move file: $GRAPHFILE"
   else
--- a/lib/scripts/timestart.bash	Thu Oct 09 11:00:15 2014 +0200
+++ b/lib/scripts/timestart.bash	Thu Oct 09 11:15:03 2014 +0200
@@ -8,7 +8,7 @@
 TIMES_RESULT=""
 
 function get_times () {
-  local TMP="/tmp/get_times$$"
+  local TMP="${TMPDIR:-/tmp}/get_times$$"
   times > "$TMP"   # No pipe here!
   TIMES_RESULT="$SECONDS $(echo $(cat "$TMP") | perl -pe 's,\d+m\d+\.\d+s \d+m\d+\.\d+s (\d+)m(\d+)\.\d+s +(\d+)m(\d+)\.\d+s, $1 * 60 + $2 + $3 * 60 + $4,e')"
   rm -f "$TMP"
--- a/src/Doc/System/Basics.thy	Thu Oct 09 11:00:15 2014 +0200
+++ b/src/Doc/System/Basics.thy	Thu Oct 09 11:15:03 2014 +0200
@@ -272,8 +272,7 @@
   
   \item[@{setting_def ISABELLE_TMP_PREFIX}@{text "\<^sup>*"}] is the
   prefix from which any running @{executable "isabelle_process"}
-  derives an individual directory for temporary files.  The default is
-  somewhere in @{file_unchecked "/tmp"}.
+  derives an individual directory for temporary files.
   
   \end{description}
 \<close>
--- a/src/Pure/System/system_channel.scala	Thu Oct 09 11:00:15 2014 +0200
+++ b/src/Pure/System/system_channel.scala	Thu Oct 09 11:15:03 2014 +0200
@@ -43,7 +43,7 @@
   {
     val i = Fifo_Channel.next_fifo()
     val script =
-      "FIFO=\"/tmp/isabelle-fifo-${PPID}-$$" + i + "\"\n" +
+      "FIFO=\"${TMPDIR:-/tmp}/isabelle-fifo-${PPID}-$$" + i + "\"\n" +
       "echo -n \"$FIFO\"\n" +
       "mkfifo -m 600 \"$FIFO\"\n"
     val result = Isabelle_System.bash(script)