OSXOperatingSystem.st
changeset 16677 0f22d24efe9f
parent 16647 4c196996c402
child 16905 46653de3c189
--- a/OSXOperatingSystem.st	Thu Jul 03 15:36:07 2014 +0200
+++ b/OSXOperatingSystem.st	Thu Jul 03 16:36:15 2014 +0200
@@ -47,21 +47,38 @@
     ^ path
 !
 
+getDriveList
+    "return a list of volumes in the system."
+
+    ^ ('/Volumes' asFilename directoryContents)
+      , super getDriveList
+!
+
 getTrashDirectory
     "get the name of a trash folder (if the OS supports it),
      or nil, if not.
      Must be redefined to return non nil in concrete operating systems"
 
     ^ '~/.Trash'
+!
+
+pathNameForDrive:driveName
+    "given a drive name, return the pathname to open it as a directory.
+     For Windows, this is the driveName itself.
+     For OSX, '/Volumes' is prepended.
+     Other OSs might prepent the pount point (i.e. /mnt/)"
+
+    driveName asFilename isAbsolute ifTrue:[^ driveName].
+    ^ '/Volumes/',driveName
 ! !
 
 !OSXOperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/OSXOperatingSystem.st,v 1.6 2014-06-29 10:07:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/OSXOperatingSystem.st,v 1.7 2014-07-03 14:36:15 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/OSXOperatingSystem.st,v 1.6 2014-06-29 10:07:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/OSXOperatingSystem.st,v 1.7 2014-07-03 14:36:15 cg Exp $'
 ! !