new: #documentsDirectory
authorStefan Vogel <sv@exept.de>
Thu, 11 Jun 2009 23:02:51 +0200
changeset 11763 78e389d28c00
parent 11762 60eb1f51ffac
child 11764 89c0c60feb24
new: #documentsDirectory
Filename.st
--- a/Filename.st	Thu Jun 11 23:01:30 2009 +0200
+++ b/Filename.st	Thu Jun 11 23:02:51 2009 +0200
@@ -322,6 +322,26 @@
     "Created: / 16-05-2007 / 13:18:34 / cg"
 !
 
+documentsDirectory
+    "return your documents directory.
+     Under windows, thats the real 'Documents' or 'My Documents'; 
+     under other OperatingSystems, the home directory is returned."
+
+    |s|
+
+    s := OperatingSystem getDocumentsDirectory.
+    s isNil ifTrue:[
+        ^ self homeDirectory
+    ].
+    ^ self named:s
+
+    "
+     Filename documentsDirectory        
+    "
+
+    "Created: / 16-05-2007 / 13:18:34 / cg"
+!
+
 findDefaultDirectory
     "same as #defaultDirectory for ST80 compatibility"
 
@@ -5675,7 +5695,7 @@
 !Filename class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.339 2009-06-10 16:24:00 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.340 2009-06-11 21:02:51 stefan Exp $'
 ! !
 
 Filename initialize!