Make temp dir accessible to all users
authorStefan Vogel <sv@exept.de>
Mon, 16 Jul 2007 22:24:35 +0200
changeset 10663 b95f903be43e
parent 10662 865a5649d8d6
child 10664 1b41c869040a
Make temp dir accessible to all users
Filename.st
--- a/Filename.st	Mon Jul 16 22:23:00 2007 +0200
+++ b/Filename.st	Mon Jul 16 22:24:35 2007 +0200
@@ -292,25 +292,6 @@
     "Modified: 8.9.1997 / 00:24:15 / cg"
 !
 
-currentDirectoryName
-    "return a filename for the current directory"
-
-    self == Filename ifTrue:[
-        ^ ConcreteClass currentDirectoryName
-    ].
-
-    "/ fallBack - works on Unix & MSDOS (but not on VMS)
-
-    ^ '.'
-
-    "
-     Filename currentDirectoryName    
-    "
-
-    "Modified: / 8.9.1997 / 00:24:15 / cg"
-    "Created: / 21.10.1998 / 17:49:57 / cg"
-!
-
 defaultDirectory
     "ST80 compatibility: same as currentDirectory"
 
@@ -321,16 +302,6 @@
     "
 !
 
-defaultDirectoryName
-    "ST80 compatibility: return the defaultDirectories name (as a string)"
-
-    ^ self defaultDirectory name
-
-    "
-     Filename defaultDirectoryName 
-    "
-!
-
 desktopDirectory
     "return your desktop directory.
      Under windows, thats the real desktop directory; 
@@ -734,9 +705,8 @@
      otherwise, '/tmp' is used. (at least on unix ...).
 
      Notice: do not hardcode '/tmp' into your programs - things may be
-             different on other OS's. Also, the user may want to set the
-             TMPDIR environment variable to have her temp files somewhere else.
-             (especially on SUNOS, the root partition is ALWAYS too small ..."
+             different on other operating systems. Also, the user may want to set the
+             TMPDIR environment variable to have her temp files somewhere else."
 
     |tempDir|
 
@@ -756,14 +726,19 @@
             tempDir := self named:self defaultTempDirectoryName
         ].
         TempDirectory := tempDir construct:'stx_tmp'.
-        TempDirectory makeDirectory.
     ].
 
     "Make sure, that the TempDirectory exists - it might have been removed
-     by a cleanup (cron) job"
+     by a cleanup (cron) job.
+     Since it is shared between users, it must be accessable by all users."
 
     TempDirectory exists ifFalse:[
-        TempDirectory makeDirectory.
+        TempDirectory 
+            makeDirectory; 
+            addAccessRights:#(readUser readGroup readOthers 
+                              writeUser writeGroup writeOthers
+                              executeUser executeGroup executeOthers
+                              removeOnlyByOwner).
     ].
     ^ TempDirectory
 
@@ -776,7 +751,6 @@
      (Filename tempDirectory construct:'foo') remove   
     "
 
-    "Modified: / 07-09-1995 / 10:48:31 / claus"
     "Created: / 07-03-1996 / 14:51:18 / cg"
     "Modified: / 29-08-2006 / 12:57:16 / cg"
 ! !
@@ -966,6 +940,35 @@
     "Modified: / 24.9.1998 / 19:10:52 / cg"
 !
 
+currentDirectoryName
+    "return a filename for the current directory"
+
+    self == Filename ifTrue:[
+        ^ ConcreteClass currentDirectoryName
+    ].
+
+    "/ fallBack - works on Unix & MSDOS (but not on VMS)
+
+    ^ '.'
+
+    "
+     Filename currentDirectoryName    
+    "
+
+    "Modified: / 8.9.1997 / 00:24:15 / cg"
+    "Created: / 21.10.1998 / 17:49:57 / cg"
+!
+
+defaultDirectoryName
+    "ST80 compatibility: return the defaultDirectories name (as a string)"
+
+    ^ self defaultDirectory name
+
+    "
+     Filename defaultDirectoryName 
+    "
+!
+
 directorySuffix
     "Return the OS dependent directory suffix string, or nil if there is none.
      The default is nil here, redefined for VMS"
@@ -5501,7 +5504,7 @@
 !Filename class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.316 2007-05-31 15:35:50 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.317 2007-07-16 20:24:35 stefan Exp $'
 ! !
 
 Filename initialize!