author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 01 Jul 2010 19:21:34 +0100 | |
branch | jv |
changeset 17772 | 6e0b3c06c364 |
parent 17767 | a4a32df3aa5e |
child 17780 | b6e42c92eba0 |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
172 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5556 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
1 | 14 |
Collection subclass:#FileDirectory |
1290 | 15 |
instanceVariableNames:'pathName lazy' |
16 |
classVariableNames:'PathOfCurrentDirectory' |
|
17 |
poolDictionaries:'' |
|
3203
09a9b6bde8af
Moved into category 'Obsolete'.
Stefan Vogel <sv@exept.de>
parents:
3201
diff
changeset
|
18 |
category:'Obsolete' |
1 | 19 |
! |
20 |
||
17734
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
21 |
ArrayedCollection subclass:#DirectoryEntry |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
22 |
instanceVariableNames:'name creationTime modificationTime dirFlag fileSize' |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
23 |
classVariableNames:'' |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
24 |
poolDictionaries:'' |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
25 |
privateIn:FileDirectory |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
26 |
! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
27 |
|
88 | 28 |
!FileDirectory class methodsFor:'documentation'! |
29 |
||
30 |
copyright |
|
31 |
" |
|
32 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
172 | 33 |
All Rights Reserved |
1 | 34 |
|
88 | 35 |
This software is furnished under a license and may be used |
36 |
only in accordance with the terms of that license and with the |
|
37 |
inclusion of the above copyright notice. This software may not |
|
38 |
be provided or otherwise made available to, or used by, any |
|
39 |
other person. No title to or ownership of the software is |
|
40 |
hereby transferred. |
|
41 |
" |
|
42 |
! |
|
1 | 43 |
|
88 | 44 |
documentation |
45 |
" |
|
3203
09a9b6bde8af
Moved into category 'Obsolete'.
Stefan Vogel <sv@exept.de>
parents:
3201
diff
changeset
|
46 |
Notice: |
09a9b6bde8af
Moved into category 'Obsolete'.
Stefan Vogel <sv@exept.de>
parents:
3201
diff
changeset
|
47 |
This class is obsolete and does work only under UNIX. |
09a9b6bde8af
Moved into category 'Obsolete'.
Stefan Vogel <sv@exept.de>
parents:
3201
diff
changeset
|
48 |
Use Filename instead. |
09a9b6bde8af
Moved into category 'Obsolete'.
Stefan Vogel <sv@exept.de>
parents:
3201
diff
changeset
|
49 |
|
09a9b6bde8af
Moved into category 'Obsolete'.
Stefan Vogel <sv@exept.de>
parents:
3201
diff
changeset
|
50 |
This class is not available in other ST-systems; |
09a9b6bde8af
Moved into category 'Obsolete'.
Stefan Vogel <sv@exept.de>
parents:
3201
diff
changeset
|
51 |
in contrast, ST-80 provides a Filename class. |
09a9b6bde8af
Moved into category 'Obsolete'.
Stefan Vogel <sv@exept.de>
parents:
3201
diff
changeset
|
52 |
Therefore, Filename has taken over the functionality. |
09a9b6bde8af
Moved into category 'Obsolete'.
Stefan Vogel <sv@exept.de>
parents:
3201
diff
changeset
|
53 |
|
88 | 54 |
FileDirectories represent directories in the underlying host system. |
55 |
They provide various methods to create/delete and query for files and/or |
|
202 | 56 |
directories. Also, since FileDirectory inherits from Collection, it |
57 |
provides all enumeration and testing protocol. For example, you can |
|
58 |
loop over the filenames in a directory using 'aFileDirectory do:[:nm | ...]'. |
|
59 |
||
1290 | 60 |
[author:] |
61 |
Claus Gittinger |
|
62 |
||
63 |
[see also:] |
|
64 |
Filename |
|
65 |
FileStream DirectoryStream OperatingSystem |
|
88 | 66 |
" |
67 |
! ! |
|
1 | 68 |
|
2 | 69 |
!FileDirectory class methodsFor:'initialization'! |
70 |
||
71 |
initialize |
|
276 | 72 |
"/ |
73 |
"/ want to know about image restart |
|
74 |
"/ |
|
2 | 75 |
ObjectMemory addDependent:self |
76 |
! |
|
77 |
||
1469 | 78 |
update:something with:aParameter from:changedObject |
276 | 79 |
"/ |
80 |
"/ currentDirectory may be different when restarted |
|
81 |
"/ |
|
3941
574defdaaa40
flush cached current-dir-path earlier.
Claus Gittinger <cg@exept.de>
parents:
3203
diff
changeset
|
82 |
something == #earlySystemInstallation ifTrue:[ |
1469 | 83 |
PathOfCurrentDirectory := nil |
2 | 84 |
] |
1469 | 85 |
|
3941
574defdaaa40
flush cached current-dir-path earlier.
Claus Gittinger <cg@exept.de>
parents:
3203
diff
changeset
|
86 |
"Created: / 15.6.1996 / 15:20:21 / cg" |
574defdaaa40
flush cached current-dir-path earlier.
Claus Gittinger <cg@exept.de>
parents:
3203
diff
changeset
|
87 |
"Modified: / 11.12.1998 / 16:28:40 / cg" |
2 | 88 |
! ! |
89 |
||
1 | 90 |
!FileDirectory class methodsFor:'instance creation'! |
91 |
||
92 |
currentDirectory |
|
93 |
"create and return a new FileDirectory for the current directory" |
|
94 |
||
2951 | 95 |
"/ self obsoleteMethodWarning:'use Filename'. |
2921 | 96 |
^ (self basicNew) pathName:(Filename currentDirectory name) |
88 | 97 |
|
98 |
" |
|
99 |
FileDirectory currentDirectory contents |
|
100 |
FileDirectory currentDirectory files |
|
101 |
FileDirectory currentDirectory isReadable |
|
102 |
FileDirectory currentDirectory pathName |
|
103 |
" |
|
1 | 104 |
! |
105 |
||
605 | 106 |
directoryNamed:name |
107 |
"create and return a new FileDirectory for the directory |
|
108 |
with given pathname" |
|
109 |
||
2951 | 110 |
"/ self obsoleteMethodWarning:'use Filename'. |
2921 | 111 |
name asString = '.' ifTrue:[ |
112 |
Filename currentDirectory name ~= '.' ifTrue:[ |
|
113 |
^ self currentDirectory |
|
114 |
] |
|
115 |
]. |
|
116 |
^ (self basicNew) pathName:(name asFilename constructString:'') |
|
605 | 117 |
|
118 |
" |
|
119 |
(FileDirectory directoryNamed:'..') pathName |
|
120 |
(FileDirectory directoryNamed:'../..') files |
|
121 |
" |
|
122 |
! |
|
123 |
||
1 | 124 |
directoryNamed:name in:aFileDirectory |
125 |
"create and return a new FileDirectory for the directory with given name |
|
126 |
in another FileDirectory" |
|
127 |
||
2961 | 128 |
|baseName| |
1 | 129 |
|
2951 | 130 |
"/ self obsoleteMethodWarning:'use Filename'. |
2921 | 131 |
|
132 |
name asFilename isAbsolute ifTrue:[ |
|
2590
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
133 |
^ self directoryNamed:name |
1 | 134 |
]. |
2921 | 135 |
|
1 | 136 |
(aFileDirectory isKindOf:FileDirectory) ifTrue:[ |
2590
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
137 |
baseName := aFileDirectory pathName |
1 | 138 |
] ifFalse:[ |
2590
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
139 |
baseName := aFileDirectory |
1 | 140 |
]. |
2921 | 141 |
^ (self basicNew) pathName:((Filename named:baseName) constructString:name) |
2590
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
142 |
|
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
143 |
"Modified: 28.4.1997 / 23:23:51 / cg" |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
144 |
"Modified: 28.4.1997 / 22:34:47 / dq" |
605 | 145 |
! |
146 |
||
147 |
rootDirectory |
|
148 |
"create and return a new FileDirectory for the root directory" |
|
149 |
||
2951 | 150 |
"/ self obsoleteMethodWarning:'use Filename'. |
2921 | 151 |
^ (self basicNew) pathName:(Filename rootDirectory name) |
605 | 152 |
|
153 |
" |
|
154 |
FileDirectory rootDirectory contents |
|
155 |
FileDirectory rootDirectory files |
|
156 |
FileDirectory rootDirectory isReadable |
|
157 |
" |
|
276 | 158 |
! ! |
159 |
||
7305 | 160 |
!FileDirectory class methodsFor:'Compatibility-Squeak'! |
5729 | 161 |
|
7655 | 162 |
default |
163 |
^ (self basicNew) pathName:(Filename defaultDirectory name) |
|
164 |
! |
|
165 |
||
5777 | 166 |
localNameFor:aFileNameString |
167 |
^ aFileNameString asFilename baseName |
|
168 |
! |
|
169 |
||
5729 | 170 |
pathNameDelimiter |
171 |
^ Filename separator |
|
172 |
! ! |
|
173 |
||
276 | 174 |
!FileDirectory class methodsFor:'private'! |
175 |
||
176 |
fullPathNameOf:name in:path |
|
177 |
|sep| |
|
178 |
||
179 |
sep := OperatingSystem fileSeparator asString. |
|
2590
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
180 |
|
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
181 |
"/ is it an absolute path ? |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
182 |
|
276 | 183 |
(name startsWith:sep) ifTrue:[ |
2590
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
184 |
^ name |
276 | 185 |
]. |
2590
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
186 |
|
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
187 |
"/ temporary kludge; this and the previous should |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
188 |
"/ go into OS isAbsolutePath .. |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
189 |
|
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
190 |
OperatingSystem isMSDOSlike ifTrue:[ |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
191 |
('[a-zA-Z]:*' match:name) ifTrue:[ |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
192 |
"/ drive spec ... |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
193 |
^ name |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
194 |
] |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
195 |
]. |
276 | 196 |
^ path , sep , name |
2590
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
197 |
|
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
198 |
"Modified: 28.4.1997 / 22:06:17 / cg" |
6855cfa1e628
temporary kludge for drive specifiers in MSDOS fileNames.
Claus Gittinger <cg@exept.de>
parents:
1469
diff
changeset
|
199 |
"Modified: 28.4.1997 / 22:34:18 / dq" |
1 | 200 |
! ! |
201 |
||
7655 | 202 |
!FileDirectory methodsFor:'Compatibility-Squeak'! |
203 |
||
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
204 |
assureExistence |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
205 |
self asFilename recursiveMakeDirectory |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
206 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
207 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
208 |
containingDirectory |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
209 |
^ self class |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
210 |
directoryNamed:(self asFilename directory pathName) |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
211 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
212 |
|
7655 | 213 |
deleteDirectory:dirName |
9332 | 214 |
"Squeak/ST80 compatibility" |
7655 | 215 |
|
216 |
^ self removeDirectory:dirName |
|
217 |
! |
|
218 |
||
219 |
deleteFileNamed:fileName |
|
9332 | 220 |
"Squeak/ST80 compatibility" |
7655 | 221 |
|
222 |
^ self removeFile:fileName |
|
223 |
! |
|
224 |
||
17734
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
225 |
directoryEntryFor:name |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
226 |
|info| |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
227 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
228 |
info := self infoOf:name. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
229 |
^ DirectoryEntry new |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
230 |
name:name |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
231 |
creationTime:(info creationTime) |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
232 |
modificationTime:(info modificationTime) |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
233 |
dirFlag:(info isDirectory) |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
234 |
fileSize:(info isDirectory) |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
235 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
236 |
" |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
237 |
(FileDirectory directoryNamed:'.') entries |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
238 |
" |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
239 |
! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
240 |
|
9332 | 241 |
directoryExists:dir |
242 |
"Squeak/ST80 compatibility" |
|
243 |
||
244 |
|f| |
|
245 |
||
246 |
f := self filenameFor:dir. |
|
247 |
^ f exists and:[f isDirectory ]. |
|
248 |
! |
|
249 |
||
7655 | 250 |
directoryNames |
9332 | 251 |
"Squeak/ST80 compatibility" |
7655 | 252 |
|
253 |
^ self directories |
|
254 |
! |
|
255 |
||
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
256 |
entries |
17734
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
257 |
^ self contents collect:[:nm | self directoryEntryFor:nm]. |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
258 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
259 |
|
9334 | 260 |
fileExists:dir |
261 |
"Squeak/ST80 compatibility" |
|
262 |
||
263 |
|f| |
|
264 |
||
265 |
f := self filenameFor:dir. |
|
266 |
^ f exists and:[f isDirectory not ]. |
|
267 |
! |
|
268 |
||
7655 | 269 |
fileNames |
9332 | 270 |
"Squeak/ST80 compatibility" |
7655 | 271 |
|
272 |
^ self files |
|
273 |
! |
|
274 |
||
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
275 |
forceNewFileNamed:fn |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
276 |
"Squeak/ST80 compatibility" |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
277 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
278 |
|f| |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
279 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
280 |
f := self filenameFor:fn. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
281 |
^ f writeStream |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
282 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
283 |
|
7655 | 284 |
includesKey:name |
9332 | 285 |
"Squeak/ST80 compatibility" |
7655 | 286 |
|
287 |
^ self exists:name |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
288 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
289 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
290 |
readOnlyFileNamed:fn |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
291 |
"Squeak/ST80 compatibility" |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
292 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
293 |
|f| |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
294 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
295 |
f := self filenameFor:fn. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
296 |
^ f readStream |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
297 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
298 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
299 |
recursiveDelete |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
300 |
self asFilename recursiveRemove |
7655 | 301 |
! ! |
7305 | 302 |
|
1 | 303 |
!FileDirectory methodsFor:'accessing'! |
304 |
||
305 |
baseName |
|
306 |
"return my baseName |
|
307 |
- thats the directory name without leading parent-dirs" |
|
308 |
||
309 |
lazy ifTrue:[self getFullPathName]. |
|
2921 | 310 |
^ pathName asFilename baseName |
1 | 311 |
! |
312 |
||
313 |
contents |
|
2708
6c4a4f30d540
skip '.' and '..' in #contents
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
314 |
"return a collection with all files and subdirectories in the receiver. |
6c4a4f30d540
skip '.' and '..' in #contents
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
315 |
Skips any '.' or '..' entries (UNIX)" |
1 | 316 |
|
317 |
|coll| |
|
318 |
||
319 |
coll := OrderedCollection new. |
|
320 |
self do:[:name | |
|
2708
6c4a4f30d540
skip '.' and '..' in #contents
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
321 |
name ~= '.' ifTrue:[ |
6c4a4f30d540
skip '.' and '..' in #contents
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
322 |
name ~= '..' ifTrue:[ |
6c4a4f30d540
skip '.' and '..' in #contents
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
323 |
coll add:name |
6c4a4f30d540
skip '.' and '..' in #contents
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
324 |
] |
6c4a4f30d540
skip '.' and '..' in #contents
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
325 |
] |
1 | 326 |
]. |
276 | 327 |
coll sort. |
1 | 328 |
^ coll |
2708
6c4a4f30d540
skip '.' and '..' in #contents
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
329 |
|
6c4a4f30d540
skip '.' and '..' in #contents
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
330 |
"Modified: 20.6.1997 / 17:05:43 / cg" |
1 | 331 |
! |
332 |
||
333 |
directories |
|
334 |
"return a collection with all subdirectories in the receiver directory" |
|
335 |
||
336 |
|coll| |
|
337 |
||
338 |
coll := OrderedCollection new. |
|
339 |
self directoriesDo:[:name | |
|
172 | 340 |
coll add:name |
1 | 341 |
]. |
276 | 342 |
coll sort. |
1 | 343 |
^ coll |
344 |
! |
|
345 |
||
605 | 346 |
directoryName |
347 |
"return my directoryName |
|
348 |
- thats the directory name where I'm in" |
|
349 |
||
350 |
lazy ifTrue:[self getFullPathName]. |
|
2921 | 351 |
^ pathName asFilename directoryName |
605 | 352 |
! |
353 |
||
1 | 354 |
files |
355 |
"return a collection with all plain files in the receiver directory" |
|
356 |
||
357 |
|coll| |
|
358 |
||
359 |
coll := OrderedCollection new. |
|
360 |
self filesDo:[:name | |
|
172 | 361 |
coll add:name |
1 | 362 |
]. |
276 | 363 |
coll sort. |
364 |
^ coll |
|
605 | 365 |
! |
366 |
||
367 |
pathName |
|
368 |
"return my full pathname" |
|
369 |
||
370 |
lazy ifTrue:[self getFullPathName]. |
|
371 |
^ pathName |
|
372 |
! |
|
373 |
||
374 |
pathName:dirName |
|
375 |
"set my pathname; return nil if not a valid path; self otherwise" |
|
376 |
||
377 |
pathName := dirName. |
|
378 |
(dirName startsWith:OperatingSystem fileSeparator) ifFalse:[ |
|
379 |
lazy := true |
|
380 |
] ifTrue:[ |
|
381 |
(dirName startsWith:'./') ifFalse:[ |
|
382 |
"/ (dirName includes:$.) ifTrue:[ |
|
383 |
lazy := true |
|
384 |
] |
|
385 |
]. |
|
386 |
^ self |
|
387 |
! ! |
|
388 |
||
389 |
!FileDirectory methodsFor:'basic'! |
|
390 |
||
391 |
createDirectory:newName |
|
392 |
"create a new filedirectory as a subdirectory of myself; |
|
393 |
return true if successful" |
|
394 |
||
395 |
|realName| |
|
396 |
||
397 |
(newName notNil and:[newName notEmpty]) ifTrue:[ |
|
398 |
(newName ~= '.' and:[newName ~= '..']) ifTrue:[ |
|
399 |
((newName at:1) == OperatingSystem fileSeparator) ifTrue:[ |
|
400 |
realName := newName copyFrom:2 |
|
401 |
] ifFalse:[ |
|
402 |
realName := newName |
|
403 |
]. |
|
2921 | 404 |
^ (self filenameFor:realName) makeDirectory |
605 | 405 |
] |
406 |
]. |
|
407 |
^ false |
|
408 |
! |
|
409 |
||
410 |
link:oldFileName to:newFileName |
|
411 |
"link oldFileName to newFileName in myself, return true if successful" |
|
412 |
||
413 |
|path1 path2| |
|
414 |
||
415 |
path1 := self pathNameOf:oldFileName. |
|
416 |
path2 := self pathNameOf:newFileName. |
|
417 |
^ OperatingSystem linkFile:path1 to:path2 |
|
418 |
! |
|
419 |
||
420 |
remove:aFileOrDirectoryName |
|
421 |
"remove the file or directory from myself; return true if successful" |
|
422 |
||
2921 | 423 |
^ (self filenameFor:aFileOrDirectoryName) remove |
605 | 424 |
! |
425 |
||
426 |
removeDirectory:dirName |
|
427 |
"remove the directory 'dirName' from myself; return true if successful. |
|
428 |
If the directory is not empty, the containing files/directories are also |
|
429 |
removed." |
|
430 |
||
2921 | 431 |
^ (self filenameFor:dirName) recursiveRemove |
605 | 432 |
! |
433 |
||
434 |
removeFile:fileName |
|
435 |
"remove the file 'fileName' from myself; return true if successful" |
|
436 |
||
2921 | 437 |
^ (self filenameFor:fileName) remove |
605 | 438 |
! |
439 |
||
440 |
renameFile:oldFileName newName:newFileName |
|
441 |
"rename the file; return true if successful" |
|
442 |
||
2921 | 443 |
|f1 f2| |
605 | 444 |
|
2921 | 445 |
f1 := self filenameFor:oldFileName. |
446 |
f2 := self filenameFor:newFileName. |
|
447 |
^ f1 renameTo:f2 |
|
1 | 448 |
! ! |
449 |
||
172 | 450 |
!FileDirectory methodsFor:'converting'! |
451 |
||
452 |
asFilename |
|
453 |
"return myself as a filename" |
|
454 |
||
455 |
^ self pathName asFilename |
|
456 |
! |
|
457 |
||
458 |
asFilename:someFile |
|
459 |
"return a filename for a file named someFile in myself" |
|
460 |
||
276 | 461 |
^ self asFilename construct:someFile |
172 | 462 |
! ! |
463 |
||
605 | 464 |
!FileDirectory methodsFor:'enumerating'! |
465 |
||
466 |
allDirectoriesDo:aBlock |
|
467 |
"evaluate the argument, aBlock for every directory name |
|
468 |
in the directory and in all subdirectories" |
|
469 |
||
470 |
|aStream command line| |
|
471 |
||
472 |
lazy ifTrue:[self getFullPathName]. |
|
473 |
command := 'cd ' , pathName , '; find . -type d -print'. |
|
474 |
aStream := PipeStream readingFrom:command. |
|
475 |
aStream isNil ifTrue:[^ nil]. |
|
476 |
[aStream atEnd] whileFalse:[ |
|
477 |
line := aStream nextLine. |
|
478 |
line notNil ifTrue:[ |
|
479 |
(line = '.') ifFalse:[ |
|
480 |
"cut off initial ./" |
|
481 |
line := line copyFrom:3 |
|
482 |
]. |
|
483 |
aBlock value:line |
|
484 |
] |
|
485 |
]. |
|
486 |
aStream close |
|
487 |
! |
|
488 |
||
489 |
allFilesDo:aBlock |
|
490 |
"evaluate the argument, aBlock for every file name in the directory and in all |
|
491 |
subdirectories" |
|
492 |
||
493 |
|aStream command line| |
|
494 |
||
495 |
lazy ifTrue:[self getFullPathName]. |
|
496 |
command := 'cd ' , pathName , '; find . -print'. |
|
497 |
aStream := PipeStream readingFrom:command. |
|
498 |
aStream isNil ifTrue:[^ nil]. |
|
499 |
[aStream atEnd] whileFalse:[ |
|
500 |
line := aStream nextLine. |
|
501 |
line notNil ifTrue:[ |
|
502 |
(line = '.') ifFalse:[ |
|
503 |
"cut off initial ./" |
|
504 |
line := line copyFrom:3 |
|
505 |
]. |
|
506 |
aBlock value:line |
|
507 |
] |
|
508 |
]. |
|
509 |
aStream close |
|
510 |
! |
|
511 |
||
512 |
directoriesDo:aBlock |
|
513 |
"evaluate the argument, aBlock for every subdirectory name in the directory" |
|
514 |
||
515 |
self where:[:name | (self isDirectory:name) ifTrue:[ |
|
516 |
((name ~= '.') and:[name ~= '..']) |
|
517 |
] ifFalse:[ |
|
518 |
false |
|
519 |
] |
|
520 |
] do:aBlock |
|
521 |
! |
|
522 |
||
523 |
do:aBlock |
|
524 |
"evaluate the argument, aBlock for every name in the directory" |
|
525 |
||
526 |
self where:[:name | true] do:aBlock |
|
527 |
! |
|
528 |
||
529 |
filesDo:aBlock |
|
530 |
"evaluate the argument, aBlock for every plain file name in the directory" |
|
531 |
||
532 |
self where:[:name | (self isDirectory:name) not] do:aBlock |
|
533 |
! |
|
534 |
||
535 |
namesDo:aBlock |
|
536 |
"evaluate the argument, aBlock for every name in the directory. |
|
537 |
for ST-80 compatibility" |
|
538 |
||
539 |
self do:aBlock |
|
540 |
! |
|
541 |
||
542 |
where:testBlock do:aBlock |
|
543 |
"evaluate the argument, aBlock for every object in the directory |
|
544 |
for which testBlock evaluates to true." |
|
545 |
||
546 |
|aStream name| |
|
547 |
||
7655 | 548 |
ExternalStream openErrorSignal catch:[ |
549 |
aStream := DirectoryStream directoryNamed:pathName. |
|
550 |
]. |
|
605 | 551 |
aStream isNil ifTrue:[^ nil]. |
552 |
[aStream atEnd] whileFalse:[ |
|
7655 | 553 |
name := aStream nextLine. |
554 |
name notNil ifTrue:[ |
|
555 |
(testBlock value:name) ifTrue:[ |
|
556 |
aBlock value:name |
|
557 |
] |
|
558 |
] |
|
605 | 559 |
]. |
560 |
aStream close |
|
561 |
! ! |
|
562 |
||
563 |
!FileDirectory methodsFor:'more instance creation'! |
|
564 |
||
565 |
directoryNamed:aName |
|
2961 | 566 |
"create & return a new fileDirectory for a subdirectory in myself" |
567 |
||
605 | 568 |
^ self class directoryNamed:aName in:self pathName |
569 |
! ! |
|
570 |
||
571 |
!FileDirectory methodsFor:'printing & storing'! |
|
572 |
||
573 |
printOn:aStream |
|
4392 | 574 |
"append a user printed representation of the receiver to aStream. |
575 |
The format is suitable for a human - not meant to be read back." |
|
605 | 576 |
|
577 |
lazy ifTrue:[self getFullPathName]. |
|
578 |
aStream nextPutAll:'(a FileDirectory pathName:'; |
|
4392 | 579 |
nextPutAll:pathName; |
580 |
nextPutAll:')' |
|
605 | 581 |
! |
582 |
||
583 |
storeOn:aStream |
|
584 |
"append a printed representation of the receiver to aStream, |
|
585 |
which allows reconstructing it via readFrom:" |
|
586 |
||
587 |
lazy ifTrue:[self getFullPathName]. |
|
588 |
aStream nextPutAll:'(FileDirectory directoryNamed:'. |
|
589 |
aStream nextPutAll:pathName. |
|
590 |
aStream nextPut:$) |
|
591 |
! ! |
|
592 |
||
1 | 593 |
!FileDirectory methodsFor:'private'! |
594 |
||
3201
4e72e420fdc3
Documentation: FileDirectory is obsolete and works only under Unix.
Stefan Vogel <sv@exept.de>
parents:
2961
diff
changeset
|
595 |
filenameFor:fileName |
6972
0a2f38d186d5
filenameFor: same algorithm found in Filename
Claus Gittinger <cg@exept.de>
parents:
6550
diff
changeset
|
596 |
"return a filename representing the argument, fileName |
0a2f38d186d5
filenameFor: same algorithm found in Filename
Claus Gittinger <cg@exept.de>
parents:
6550
diff
changeset
|
597 |
either in myself (if the arg is a releative path) or absolute otherwise." |
3201
4e72e420fdc3
Documentation: FileDirectory is obsolete and works only under Unix.
Stefan Vogel <sv@exept.de>
parents:
2961
diff
changeset
|
598 |
|
6972
0a2f38d186d5
filenameFor: same algorithm found in Filename
Claus Gittinger <cg@exept.de>
parents:
6550
diff
changeset
|
599 |
^ pathName asFilename filenameFor:fileName |
3201
4e72e420fdc3
Documentation: FileDirectory is obsolete and works only under Unix.
Stefan Vogel <sv@exept.de>
parents:
2961
diff
changeset
|
600 |
! |
4e72e420fdc3
Documentation: FileDirectory is obsolete and works only under Unix.
Stefan Vogel <sv@exept.de>
parents:
2961
diff
changeset
|
601 |
|
9334 | 602 |
fullNameFor:fileName |
603 |
"return a filename representing the argument, fileName |
|
604 |
either in myself (if the arg is a releative path) or absolute otherwise." |
|
605 |
||
606 |
^ (pathName asFilename filenameFor:fileName) asAbsoluteFilename |
|
607 |
! |
|
608 |
||
1 | 609 |
getFullPathName |
610 |
"make my pathname be a full pathname - i.e. starting at root" |
|
611 |
||
308 | 612 |
|shortPathName| |
1 | 613 |
|
2921 | 614 |
|
159 | 615 |
(pathName = OperatingSystem fileSeparator asString) ifTrue:[ |
172 | 616 |
lazy := false. |
617 |
^ self |
|
1 | 618 |
]. |
619 |
||
620 |
"since currentDirectory is used very often, cache its path here" |
|
621 |
||
622 |
(pathName = '.') ifTrue:[ |
|
172 | 623 |
PathOfCurrentDirectory notNil ifTrue:[ |
624 |
pathName := PathOfCurrentDirectory. |
|
625 |
lazy := false. |
|
626 |
^ self |
|
627 |
] |
|
1 | 628 |
]. |
629 |
||
630 |
shortPathName := pathName. |
|
631 |
||
308 | 632 |
pathName := OperatingSystem pathNameOf:pathName. |
633 |
lazy := false. |
|
1 | 634 |
|
308 | 635 |
" |
636 |
if it was the current dir, keep name for next query |
|
637 |
" |
|
1 | 638 |
(shortPathName = '.') ifTrue:[ |
308 | 639 |
PathOfCurrentDirectory := pathName |
1 | 640 |
] |
276 | 641 |
! |
642 |
||
643 |
pathNameOf:fileName |
|
2961 | 644 |
"return the pathname for an entry in myself" |
645 |
||
2921 | 646 |
^ (pathName asFilename construct:fileName) osName |
1 | 647 |
! ! |
648 |
||
605 | 649 |
!FileDirectory methodsFor:'queries'! |
1 | 650 |
|
605 | 651 |
accessModeOf:name |
652 |
"return the access-mode bits (rwxrwxrwx) of a file in myself" |
|
1 | 653 |
|
605 | 654 |
^ OperatingSystem accessModeOf:(self pathNameOf:name) |
1 | 655 |
! |
656 |
||
605 | 657 |
changeAccessModeOf:name to:modeBits |
658 |
"set the access-mode bits (rwxrwxrwx) of a file in myself" |
|
1 | 659 |
|
605 | 660 |
^ OperatingSystem changeAccessModeOf:(self pathNameOf:name) to:modeBits |
1 | 661 |
! |
662 |
||
663 |
exists |
|
664 |
"return true if this directory exists" |
|
665 |
||
2921 | 666 |
^ (Filename named:pathName) isDirectory |
159 | 667 |
|
668 |
" |
|
669 |
(FileDirectory directoryNamed:'fooBar') exists |
|
670 |
(FileDirectory directoryNamed:'/tmp') exists |
|
671 |
" |
|
1 | 672 |
! |
673 |
||
605 | 674 |
exists:name |
675 |
"return true, if the given name exists in myself" |
|
676 |
||
2921 | 677 |
^ (self filenameFor:name) exists |
605 | 678 |
! |
679 |
||
680 |
id |
|
681 |
"return the directories file-id (inode number)" |
|
682 |
||
2921 | 683 |
^ (Filename named:pathName) id |
605 | 684 |
! |
685 |
||
686 |
infoOf:name |
|
687 |
"return an array filled with file info for the file 'aFileName'; |
|
688 |
return nil if such a file does not exist" |
|
689 |
||
2921 | 690 |
^ (self filenameFor:name) info |
605 | 691 |
! |
692 |
||
693 |
isDirectory:name |
|
694 |
"return true, if the given name is that of a directory in myself" |
|
695 |
||
2921 | 696 |
^ (self filenameFor:name) isDirectory |
605 | 697 |
! |
698 |
||
699 |
isExecutable:name |
|
700 |
"return true, if the given file is executable" |
|
1 | 701 |
|
2921 | 702 |
^ (self filenameFor:name) isExecutable |
1 | 703 |
! |
704 |
||
705 |
isReadable:name |
|
706 |
"return true, if the given file is readable" |
|
707 |
||
2921 | 708 |
^ (self filenameFor:name) isReadable |
1 | 709 |
! |
710 |
||
711 |
isWritable:name |
|
712 |
"return true, if the given file is readable" |
|
713 |
||
2921 | 714 |
^ (self filenameFor:name) isWritable |
1 | 715 |
! |
716 |
||
605 | 717 |
species |
6550 | 718 |
"return the type of collection to be returned by collect, select etc." |
719 |
||
605 | 720 |
^ OrderedCollection |
1 | 721 |
! |
722 |
||
605 | 723 |
timeOfLastChange |
724 |
"return the timeStamp of myself" |
|
1 | 725 |
|
2921 | 726 |
^ (Filename named:pathName) modificationTime |
1 | 727 |
! |
728 |
||
605 | 729 |
timeOfLastChange:name |
730 |
"return the timeStamp of a file in myself" |
|
1 | 731 |
|
2921 | 732 |
^ (self filenameFor:name) modificationTime |
1 | 733 |
! |
734 |
||
605 | 735 |
typeOf:name |
736 |
"return the symbolic type of a file in myself" |
|
1 | 737 |
|
2921 | 738 |
^ (self filenameFor:name) type |
605 | 739 |
! ! |
1 | 740 |
|
5556 | 741 |
!FileDirectory methodsFor:'testing'! |
742 |
||
743 |
isEmpty |
|
744 |
"return true, if the directory is empty; |
|
745 |
redefined since '.' and '..' do not count as entries here." |
|
746 |
||
747 |
self do:[:fName | |
|
748 |
((fName ~= '.') and:[fName ~= '..']) ifTrue:[^ false]. |
|
749 |
]. |
|
750 |
^ true |
|
751 |
! ! |
|
752 |
||
17734
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
753 |
!FileDirectory::DirectoryEntry methodsFor:'accessing'! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
754 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
755 |
at: index |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
756 |
"compatibility interface" |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
757 |
"self halt: 'old-style access to DirectoryEntry'" |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
758 |
index = 1 ifTrue: [ ^self name ]. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
759 |
index = 2 ifTrue: [ ^self creationTime ]. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
760 |
index = 3 ifTrue: [ ^self modificationTime ]. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
761 |
index = 4 ifTrue:[ ^self isDirectory ]. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
762 |
index = 5 ifTrue:[ ^self fileSize ]. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
763 |
self error: 'invalid index specified'. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
764 |
! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
765 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
766 |
creationTime |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
767 |
^ creationTime |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
768 |
! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
769 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
770 |
dirFlag |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
771 |
^ dirFlag |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
772 |
! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
773 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
774 |
fileSize |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
775 |
^ fileSize |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
776 |
! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
777 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
778 |
modificationTime |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
779 |
^ modificationTime |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
780 |
! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
781 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
782 |
name |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
783 |
^ name |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
784 |
! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
785 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
786 |
name:nameArg creationTime:creationTimeArg modificationTime:modificationTimeArg dirFlag:dirFlagArg fileSize:fileSizeArg |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
787 |
name := nameArg. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
788 |
creationTime := creationTimeArg. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
789 |
modificationTime := modificationTimeArg. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
790 |
dirFlag := dirFlagArg. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
791 |
fileSize := fileSizeArg. |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
792 |
! ! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
793 |
|
629 | 794 |
!FileDirectory class methodsFor:'documentation'! |
795 |
||
796 |
version |
|
17772
6e0b3c06c364
Method reverted to r10532
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17767
diff
changeset
|
797 |
^ '$Id: FileDirectory.st 10534 2010-07-01 18:21:34Z vranyj1 $' |
17734
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
798 |
! |
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
799 |
|
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
800 |
version_CVS |
17772
6e0b3c06c364
Method reverted to r10532
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17767
diff
changeset
|
801 |
^ '§Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.49 2009/10/26 15:24:34 cg Exp §' |
629 | 802 |
! ! |
6972
0a2f38d186d5
filenameFor: same algorithm found in Filename
Claus Gittinger <cg@exept.de>
parents:
6550
diff
changeset
|
803 |
|
605 | 804 |
FileDirectory initialize! |
17734
406b1590afe8
Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
805 |
|
17735 | 806 |
|
17767 | 807 |
|
17772
6e0b3c06c364
Method reverted to r10532
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17767
diff
changeset
|
808 |