class: Filename
authorClaus Gittinger <cg@exept.de>
Thu, 13 Nov 2014 12:28:50 +0100
changeset 17048 89053971191b
parent 17047 add3f6361c26
child 17049 6ddd0b99a693
class: Filename comment/format in: #defaultTempDirectory #tempDirectory: changed: #tempDirectory
Filename.st
--- a/Filename.st	Thu Nov 13 12:25:45 2014 +0100
+++ b/Filename.st	Thu Nov 13 12:28:50 2014 +0100
@@ -322,11 +322,11 @@
 defaultTempDirectory
     "return the default temp directory as a filename.
      That is the same as TempDirectory, except that TempDirectory can be changed
-     from the outside (via tempDirectory:).
+     from the outside (via tempDirectory:) whereas this is the OS's original default.
      Use this for files which MUST remain the same (stx_sourceCache)"
 
     DefaultTempDirectory isNil ifTrue:[
-        self tempDirectory.
+        self tempDirectory.  "/ actually sets DefaultTempDirectory as side effect
         DefaultTempDirectory isNil ifTrue:[
             DefaultTempDirectory := TempDirectory
         ].
@@ -787,27 +787,14 @@
     |tempDir|
 
     TempDirectory isNil ifTrue:[
-        #('STX_TMPDIR' 'ST_TMPDIR' 'TMPDIR' 'TEMPDIR' 'TEMP' 'TMP') do:[:envVar |
-            tempDir isNil ifTrue:[
-                tempDir := OperatingSystem getEnvironment:envVar.
-                tempDir notNil ifTrue:[
-                    tempDir := self named:tempDir.
-                    tempDir exists ifFalse:[
-                        tempDir := nil.
-                    ].
-                ].
-            ].
-        ].
-        tempDir isNil ifTrue:[
-            tempDir := self named:(self defaultTempDirectoryName pathName).
-            tempDir exists ifFalse:[
-                tempDir
-                    makeDirectory; 
-                    addAccessRights:#(readUser readGroup readOthers 
-                                      writeUser writeGroup writeOthers
-                                      executeUser executeGroup executeOthers
-                                      removeOnlyByOwner).
-            ].
+        tempDir := self named:(self defaultTempDirectoryName pathName).
+        tempDir exists ifFalse:[
+            tempDir
+                makeDirectory; 
+                addAccessRights:#(readUser readGroup readOthers 
+                                  writeUser writeGroup writeOthers
+                                  executeUser executeGroup executeOthers
+                                  removeOnlyByOwner).
         ].
         TempDirectory := DefaultTempDirectory := tempDir construct:'stx_tmp'.
     ].
@@ -840,7 +827,10 @@
 !
 
 tempDirectory:aFilename
-    "set the xdefault temporary directory pathname"
+    "set the default temporary directory.
+     This allows overwriting the automatically determined tmpDirectory
+     by a knowledgable stand alone startup program.
+     Do not use elsewhere (and only if absolutely requried)"
 
     |temp|
 
@@ -6067,11 +6057,11 @@
 !Filename class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.427 2014-11-08 09:05:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.428 2014-11-13 11:28:50 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.427 2014-11-08 09:05:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.428 2014-11-13 11:28:50 cg Exp $'
 ! !