14819
|
1 |
"{ Package: 'stx:libbasic' }"
|
|
2 |
|
|
3 |
UnixOperatingSystem subclass:#OSXOperatingSystem
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'OS-Unix'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!OSXOperatingSystem class methodsFor:'file queries'!
|
|
12 |
|
|
13 |
caseSensitiveFilenames
|
|
14 |
"return true, if the OS has caseSensitive file naming.
|
|
15 |
On MSDOS, this will return false;
|
|
16 |
on a real OS, we return true."
|
|
17 |
|
|
18 |
^ false
|
|
19 |
|
|
20 |
"Modified: / 5.6.1998 / 18:35:18 / cg"
|
16381
|
21 |
!
|
|
22 |
|
16644
|
23 |
defaultPackagePath
|
|
24 |
"redefined to add stx.app packages and /Library stuff"
|
|
25 |
|
|
26 |
|path executablePath executableDir packagesDir libDir vsnDirName vsnDir|
|
|
27 |
|
|
28 |
path := super defaultPackagePath.
|
|
29 |
|
|
30 |
executablePath := OperatingSystem pathOfSTXExecutable.
|
|
31 |
executablePath notNil ifTrue:[
|
|
32 |
executableDir := executablePath asFilename directory.
|
|
33 |
packagesDir := executableDir directory directory / 'Packages'.
|
|
34 |
packagesDir exists ifTrue:[
|
|
35 |
path add:packagesDir.
|
|
36 |
].
|
|
37 |
libDir := '/Library/Smalltalk-x' asFilename.
|
|
38 |
libDir exists ifTrue:[
|
|
39 |
vsnDirName := '%1.%2' bindWith:Smalltalk majorVersionNr
|
|
40 |
with:Smalltalk minorVersionNr.
|
|
41 |
vsnDir := libDir / vsnDirName.
|
|
42 |
vsnDir exists ifTrue:[
|
|
43 |
path add:vsnDir.
|
|
44 |
].
|
|
45 |
].
|
|
46 |
].
|
16647
|
47 |
^ path
|
16644
|
48 |
!
|
|
49 |
|
16677
|
50 |
getDriveList
|
|
51 |
"return a list of volumes in the system."
|
|
52 |
|
|
53 |
^ ('/Volumes' asFilename directoryContents)
|
|
54 |
, super getDriveList
|
|
55 |
!
|
|
56 |
|
16381
|
57 |
getTrashDirectory
|
|
58 |
"get the name of a trash folder (if the OS supports it),
|
|
59 |
or nil, if not.
|
|
60 |
Must be redefined to return non nil in concrete operating systems"
|
|
61 |
|
|
62 |
^ '~/.Trash'
|
16677
|
63 |
!
|
|
64 |
|
|
65 |
pathNameForDrive:driveName
|
|
66 |
"given a drive name, return the pathname to open it as a directory.
|
|
67 |
For Windows, this is the driveName itself.
|
|
68 |
For OSX, '/Volumes' is prepended.
|
|
69 |
Other OSs might prepent the pount point (i.e. /mnt/)"
|
|
70 |
|
16905
|
71 |
driveName isNil ifTrue:[^ nil].
|
16677
|
72 |
driveName asFilename isAbsolute ifTrue:[^ driveName].
|
|
73 |
^ '/Volumes/',driveName
|
14819
|
74 |
! !
|
|
75 |
|
|
76 |
!OSXOperatingSystem class methodsFor:'documentation'!
|
|
77 |
|
|
78 |
version
|
16905
|
79 |
^ '$Header: /cvs/stx/stx/libbasic/OSXOperatingSystem.st,v 1.8 2014-10-23 10:59:46 cg Exp $'
|
14819
|
80 |
!
|
|
81 |
|
|
82 |
version_CVS
|
16905
|
83 |
^ '$Header: /cvs/stx/stx/libbasic/OSXOperatingSystem.st,v 1.8 2014-10-23 10:59:46 cg Exp $'
|
14819
|
84 |
! !
|
|
85 |
|