1
|
1 |
"
|
5
|
2 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
1
|
3 |
All Rights Reserved
|
|
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 |
"
|
|
12 |
|
|
13 |
Collection subclass:#FileDirectory
|
|
14 |
instanceVariableNames:'pathName lazy'
|
31
|
15 |
classVariableNames:'PathOfCurrentDirectory'
|
1
|
16 |
poolDictionaries:''
|
|
17 |
category:'Collections-Files'
|
|
18 |
!
|
|
19 |
|
|
20 |
FileDirectory comment:'
|
5
|
21 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
1
|
22 |
All Rights Reserved
|
92
|
23 |
|
159
|
24 |
$Header: /cvs/stx/stx/libbasic/Attic/FileDir.st,v 1.12 1994-10-10 00:26:00 claus Exp $
|
88
|
25 |
'!
|
1
|
26 |
|
88
|
27 |
!FileDirectory class methodsFor:'documentation'!
|
|
28 |
|
|
29 |
copyright
|
|
30 |
"
|
|
31 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
|
32 |
All Rights Reserved
|
1
|
33 |
|
88
|
34 |
This software is furnished under a license and may be used
|
|
35 |
only in accordance with the terms of that license and with the
|
|
36 |
inclusion of the above copyright notice. This software may not
|
|
37 |
be provided or otherwise made available to, or used by, any
|
|
38 |
other person. No title to or ownership of the software is
|
|
39 |
hereby transferred.
|
|
40 |
"
|
|
41 |
!
|
1
|
42 |
|
88
|
43 |
version
|
|
44 |
"
|
159
|
45 |
$Header: /cvs/stx/stx/libbasic/Attic/FileDir.st,v 1.12 1994-10-10 00:26:00 claus Exp $
|
88
|
46 |
"
|
|
47 |
!
|
|
48 |
|
|
49 |
documentation
|
|
50 |
"
|
|
51 |
FileDirectories represent directories in the underlying host system.
|
|
52 |
They provide various methods to create/delete and query for files and/or
|
|
53 |
directories.
|
|
54 |
"
|
|
55 |
! !
|
1
|
56 |
|
2
|
57 |
!FileDirectory class methodsFor:'initialization'!
|
|
58 |
|
|
59 |
initialize
|
|
60 |
super initialize.
|
|
61 |
ObjectMemory addDependent:self
|
|
62 |
!
|
|
63 |
|
|
64 |
update:something
|
|
65 |
something == #restarted ifTrue:[
|
31
|
66 |
PathOfCurrentDirectory := nil
|
2
|
67 |
]
|
|
68 |
! !
|
|
69 |
|
1
|
70 |
!FileDirectory class methodsFor:'instance creation'!
|
|
71 |
|
|
72 |
rootDirectory
|
|
73 |
"create and return a new FileDirectory for the root directory"
|
|
74 |
|
159
|
75 |
^ (self basicNew) pathName:(OperatingSystem fileSeparator asString)
|
88
|
76 |
|
|
77 |
"
|
|
78 |
FileDirectory rootDirectory contents
|
|
79 |
FileDirectory rootDirectory files
|
|
80 |
FileDirectory rootDirectory isReadable
|
|
81 |
"
|
1
|
82 |
!
|
|
83 |
|
|
84 |
currentDirectory
|
|
85 |
"create and return a new FileDirectory for the current directory"
|
|
86 |
|
|
87 |
^ (self basicNew) pathName:'.'
|
88
|
88 |
|
|
89 |
"
|
|
90 |
FileDirectory currentDirectory contents
|
|
91 |
FileDirectory currentDirectory files
|
|
92 |
FileDirectory currentDirectory isReadable
|
|
93 |
FileDirectory currentDirectory pathName
|
|
94 |
"
|
1
|
95 |
!
|
|
96 |
|
|
97 |
directoryNamed:name
|
|
98 |
"create and return a new FileDirectory for the directory
|
|
99 |
with given pathname"
|
|
100 |
|
|
101 |
^ (self basicNew) pathName:name
|
88
|
102 |
|
|
103 |
"
|
|
104 |
(FileDirectory directoryNamed:'..') pathName
|
|
105 |
(FileDirectory directoryNamed:'../..') files
|
|
106 |
"
|
1
|
107 |
!
|
|
108 |
|
|
109 |
directoryNamed:name in:aFileDirectory
|
|
110 |
"create and return a new FileDirectory for the directory with given name
|
|
111 |
in another FileDirectory"
|
|
112 |
|
159
|
113 |
|baseName sep|
|
1
|
114 |
|
159
|
115 |
sep := OperatingSystem fileSeparator.
|
|
116 |
((name at:1) == sep) ifTrue:[
|
1
|
117 |
^ self directoryNamed:name
|
|
118 |
].
|
|
119 |
(aFileDirectory isKindOf:FileDirectory) ifTrue:[
|
|
120 |
baseName := aFileDirectory pathName
|
|
121 |
] ifFalse:[
|
|
122 |
baseName := aFileDirectory
|
|
123 |
].
|
|
124 |
"
|
|
125 |
(name = '..') ifTrue:[
|
|
126 |
^ (self basicNew) pathName:(OperatingSystem directoryNameOf:baseName)
|
|
127 |
].
|
|
128 |
"
|
|
129 |
(name = '.') ifTrue:[^ aFileDirectory].
|
|
130 |
|
159
|
131 |
(baseName = sep asString) ifFalse:[
|
|
132 |
(baseName endsWith:sep) ifFalse:[
|
|
133 |
baseName := baseName copyWith:sep
|
1
|
134 |
]
|
|
135 |
].
|
|
136 |
^ (self basicNew) pathName:(baseName , name)
|
|
137 |
! !
|
|
138 |
|
|
139 |
!FileDirectory methodsFor:'accessing'!
|
|
140 |
|
|
141 |
baseName
|
|
142 |
"return my baseName
|
|
143 |
- thats the directory name without leading parent-dirs"
|
|
144 |
|
|
145 |
lazy ifTrue:[self getFullPathName].
|
|
146 |
^ OperatingSystem baseNameOf:pathName
|
|
147 |
!
|
|
148 |
|
|
149 |
directoryName
|
|
150 |
"return my directoryName
|
|
151 |
- thats the directory name where I'm in"
|
|
152 |
|
|
153 |
lazy ifTrue:[self getFullPathName].
|
|
154 |
^ OperatingSystem directoryNameOf:pathName
|
|
155 |
!
|
|
156 |
|
|
157 |
pathName
|
|
158 |
"return my full pathname"
|
|
159 |
|
|
160 |
lazy ifTrue:[self getFullPathName].
|
|
161 |
^ pathName
|
|
162 |
!
|
|
163 |
|
|
164 |
pathName:dirName
|
|
165 |
"set my pathname; return nil if not a valid path; self otherwise"
|
|
166 |
|
|
167 |
pathName := dirName.
|
159
|
168 |
(dirName startsWith:OperatingSystem fileSeparator) ifFalse:[
|
1
|
169 |
lazy := true
|
|
170 |
] ifTrue:[
|
|
171 |
(dirName includes:$.) ifTrue:[
|
|
172 |
lazy := true
|
|
173 |
]
|
|
174 |
].
|
|
175 |
^ self
|
|
176 |
"
|
|
177 |
(OperatingSystem isDirectory:pathName) ifFalse:[^ nil]
|
|
178 |
"
|
|
179 |
!
|
|
180 |
|
|
181 |
contents
|
|
182 |
"return a collection with all files and subdirectories in the receiver"
|
|
183 |
|
|
184 |
|coll|
|
|
185 |
|
|
186 |
coll := OrderedCollection new.
|
|
187 |
self do:[:name |
|
|
188 |
coll add:name
|
|
189 |
].
|
|
190 |
(coll size ~~ 0) ifTrue:[
|
|
191 |
coll sort
|
|
192 |
].
|
|
193 |
^ coll
|
|
194 |
!
|
|
195 |
|
|
196 |
directories
|
|
197 |
"return a collection with all subdirectories in the receiver directory"
|
|
198 |
|
|
199 |
|coll|
|
|
200 |
|
|
201 |
coll := OrderedCollection new.
|
|
202 |
self directoriesDo:[:name |
|
|
203 |
coll add:name
|
|
204 |
].
|
|
205 |
(coll size ~~ 0) ifTrue:[
|
|
206 |
coll sort
|
|
207 |
].
|
|
208 |
^ coll
|
|
209 |
!
|
|
210 |
|
|
211 |
files
|
|
212 |
"return a collection with all plain files in the receiver directory"
|
|
213 |
|
|
214 |
|coll|
|
|
215 |
|
|
216 |
coll := OrderedCollection new.
|
|
217 |
self filesDo:[:name |
|
|
218 |
coll add:name
|
|
219 |
].
|
|
220 |
^ coll sort
|
|
221 |
! !
|
|
222 |
|
|
223 |
!FileDirectory methodsFor:'private'!
|
|
224 |
|
|
225 |
getFullPathName
|
|
226 |
"make my pathname be a full pathname - i.e. starting at root"
|
|
227 |
|
|
228 |
|aStream command shortPathName fullPathName|
|
|
229 |
|
159
|
230 |
(pathName = OperatingSystem fileSeparator asString) ifTrue:[
|
1
|
231 |
lazy := false.
|
|
232 |
^ self
|
|
233 |
].
|
|
234 |
|
|
235 |
"since currentDirectory is used very often, cache its path here"
|
|
236 |
|
|
237 |
(pathName = '.') ifTrue:[
|
31
|
238 |
PathOfCurrentDirectory notNil ifTrue:[
|
|
239 |
pathName := PathOfCurrentDirectory.
|
1
|
240 |
lazy := false.
|
|
241 |
^ self
|
|
242 |
]
|
|
243 |
].
|
|
244 |
|
|
245 |
shortPathName := pathName.
|
|
246 |
|
13
|
247 |
"some have a convenient function for this ..."
|
|
248 |
%{ /* STACK: 16000 */
|
|
249 |
#ifdef HAS_REALPATH
|
1
|
250 |
# include <stdlib.h>
|
|
251 |
# include <sys/param.h>
|
|
252 |
|
|
253 |
char nameBuffer[MAXPATHLEN + 1];
|
|
254 |
|
|
255 |
if (realpath(_stringVal(_INST(pathName)), nameBuffer)) {
|
3
|
256 |
fullPathName = _MKSTRING(nameBuffer COMMA_CON);
|
1
|
257 |
}
|
|
258 |
#endif
|
|
259 |
%}
|
|
260 |
.
|
|
261 |
fullPathName notNil ifTrue:[
|
3
|
262 |
pathName := fullPathName.
|
|
263 |
lazy := false
|
1
|
264 |
] ifFalse:[
|
|
265 |
"since there might be symbolic links and other stuff involved,
|
|
266 |
better trust pwd than removing '..' by ourself
|
|
267 |
- although this is very slow"
|
|
268 |
|
|
269 |
command := 'cd ' , pathName , '; pwd'.
|
|
270 |
aStream := PipeStream readingFrom:command.
|
|
271 |
aStream isNil ifFalse:[
|
|
272 |
(aStream atEnd) ifFalse:[
|
|
273 |
fullPathName := aStream nextLine
|
|
274 |
].
|
|
275 |
aStream close.
|
|
276 |
fullPathName notNil ifTrue:[
|
|
277 |
pathName := fullPathName.
|
|
278 |
lazy := false
|
|
279 |
]
|
|
280 |
] ifTrue:[
|
|
281 |
self error:('PipeStream for <' , command , '> failed').
|
|
282 |
"by clearing lazy, we avoid triggering the error again"
|
|
283 |
lazy := false
|
|
284 |
]
|
|
285 |
].
|
|
286 |
|
|
287 |
"if it was the current dir, keep name for next query"
|
|
288 |
(shortPathName = '.') ifTrue:[
|
31
|
289 |
PathOfCurrentDirectory := fullPathName
|
1
|
290 |
]
|
|
291 |
! !
|
|
292 |
|
|
293 |
!FileDirectory methodsFor:'basic'!
|
|
294 |
|
|
295 |
createDirectory:newName
|
|
296 |
"create a new filedirectory as a subdirectory of myself;
|
|
297 |
return true if successful"
|
|
298 |
|
|
299 |
|realName|
|
|
300 |
|
|
301 |
(newName = '.') ifFalse:[
|
|
302 |
(newName = '..') ifFalse:[
|
159
|
303 |
((newName at:1) == OperatingSystem fileSeparator) ifTrue:[
|
1
|
304 |
realName := newName copyFrom:2
|
|
305 |
] ifFalse:[
|
|
306 |
realName := newName
|
|
307 |
].
|
159
|
308 |
^ OperatingSystem createDirectory:(self class fullPathNameOf:realName in:pathName)
|
1
|
309 |
]
|
|
310 |
].
|
|
311 |
^ false
|
|
312 |
!
|
|
313 |
|
|
314 |
removeFile:fileName
|
|
315 |
"remove the file 'fileName' from myself; return true if successful"
|
|
316 |
|
159
|
317 |
^ OperatingSystem removeFile:(self class fullPathNameOf:fileName in:pathName).
|
1
|
318 |
!
|
|
319 |
|
|
320 |
removeDirectory:dirName
|
19
|
321 |
"remove the directory 'dirName' from myself; return true if successful.
|
20
|
322 |
If the directory is not empty, the containing files/directories are also
|
19
|
323 |
removed."
|
|
324 |
|
159
|
325 |
|path|
|
1
|
326 |
|
159
|
327 |
path := self class fullPathNameOf:dirName in:pathName.
|
|
328 |
(OperatingSystem removeDirectory:path) ifTrue:[^ true].
|
|
329 |
^ OperatingSystem recursiveRemoveDirectory:path
|
1
|
330 |
!
|
|
331 |
|
|
332 |
remove:aFileOrDirectoryName
|
|
333 |
"remove the file or directory from myself; return true if successful"
|
|
334 |
|
|
335 |
|path|
|
|
336 |
|
159
|
337 |
path := self class fullPathNameOf:aFileOrDirectoryName in:pathName.
|
1
|
338 |
(OperatingSystem isDirectory:path) ifTrue:[
|
|
339 |
^ OperatingSystem removeDirectory:path
|
|
340 |
].
|
|
341 |
^ OperatingSystem removeFile:path
|
|
342 |
!
|
|
343 |
|
|
344 |
link:oldFileName to:newFileName
|
|
345 |
"link oldFileName to newFileName in myself, return true if successful"
|
|
346 |
|
|
347 |
|path1 path2|
|
|
348 |
|
159
|
349 |
path1 := self class fullPathNameOf:oldFileName in:pathName.
|
|
350 |
path2 := self class fullPathNameOf:newFileName in:pathName.
|
54
|
351 |
^ OperatingSystem linkFile:path1 to:path2
|
1
|
352 |
!
|
|
353 |
|
|
354 |
renameFile:oldFileName newName:newFileName
|
|
355 |
"rename the file; return true if successful"
|
|
356 |
|
|
357 |
|path1 path2|
|
|
358 |
|
159
|
359 |
path1 := self class fullPathNameOf:oldFileName in:pathName.
|
|
360 |
path2 := self class fullPathNameOf:newFileName in:pathName.
|
|
361 |
^ OperatingSystem renameFile:path1 to:path2
|
|
362 |
! !
|
|
363 |
|
|
364 |
!FileDirectory class methodsFor:'private'!
|
|
365 |
|
|
366 |
fullPathNameOf:name in:path
|
|
367 |
(name startsWith:OperatingSystem fileSeparator) ifTrue:[
|
|
368 |
^ name
|
1
|
369 |
].
|
159
|
370 |
^ path , OperatingSystem fileSeparator asString , name
|
1
|
371 |
! !
|
|
372 |
|
|
373 |
!FileDirectory methodsFor:'queries'!
|
|
374 |
|
|
375 |
id
|
|
376 |
"return the directories file-id (inode number)"
|
|
377 |
|
|
378 |
^ OperatingSystem idOf:pathName
|
|
379 |
!
|
|
380 |
|
|
381 |
exists
|
|
382 |
"return true if this directory exists"
|
|
383 |
|
|
384 |
^ OperatingSystem isDirectory:pathName
|
159
|
385 |
|
|
386 |
"
|
|
387 |
(FileDirectory directoryNamed:'fooBar') exists
|
|
388 |
(FileDirectory directoryNamed:'/tmp') exists
|
|
389 |
"
|
1
|
390 |
!
|
|
391 |
|
3
|
392 |
isEmpty
|
|
393 |
"return true, if the directory is empty;
|
|
394 |
redefined since '.' and '..' do not count as entries here."
|
|
395 |
|
|
396 |
self do:[:fName |
|
|
397 |
((fName ~= '.') and:[fName ~= '..']) ifTrue:[^ false].
|
|
398 |
].
|
|
399 |
^ true
|
|
400 |
!
|
|
401 |
|
1
|
402 |
infoOf:name
|
|
403 |
"return an array filled with file info for the file 'aFileName';
|
|
404 |
return nil if such a file does not exist"
|
|
405 |
|
159
|
406 |
^ OperatingSystem infoOf:(self class fullPathNameOf:name in:pathName)
|
1
|
407 |
!
|
|
408 |
|
|
409 |
timeOfLastChange:name
|
|
410 |
"return the timeStamp of a file in myself"
|
|
411 |
|
159
|
412 |
^ OperatingSystem timeOfLastChange:(self class fullPathNameOf:name in:pathName)
|
1
|
413 |
!
|
|
414 |
|
|
415 |
timeOfLastChange
|
|
416 |
"return the timeStamp of myself"
|
|
417 |
|
|
418 |
^ OperatingSystem timeOfLastChange:pathName
|
|
419 |
!
|
|
420 |
|
159
|
421 |
accessModeOf:name
|
1
|
422 |
"return the access-mode bits (rwxrwxrwx) of a file in myself"
|
|
423 |
|
159
|
424 |
^ OperatingSystem accessModeOf:(self class fullPathNameOf:name in:pathName)
|
1
|
425 |
!
|
|
426 |
|
159
|
427 |
changeAccessModeOf:name to:modeBits
|
1
|
428 |
"set the access-mode bits (rwxrwxrwx) of a file in myself"
|
|
429 |
|
159
|
430 |
^ OperatingSystem changeAccessModeOf:(self class fullPathNameOf:name in:pathName)
|
1
|
431 |
to:modeBits
|
|
432 |
!
|
|
433 |
|
159
|
434 |
typeOf:name
|
1
|
435 |
"return the symbolic type of a file in myself"
|
|
436 |
|
159
|
437 |
^ OperatingSystem typeOf:(self class fullPathNameOf:name in:pathName)
|
1
|
438 |
!
|
|
439 |
|
92
|
440 |
exists:name
|
|
441 |
"return true, if the given name exists in myself"
|
|
442 |
|
159
|
443 |
^ OperatingSystem isValidPath:(self class fullPathNameOf:name in:pathName)
|
92
|
444 |
!
|
|
445 |
|
1
|
446 |
isDirectory:name
|
|
447 |
"return true, if the given name is that of a directory in myself"
|
|
448 |
|
159
|
449 |
^ OperatingSystem isDirectory:(self class fullPathNameOf:name in:pathName)
|
1
|
450 |
!
|
|
451 |
|
|
452 |
isReadable:name
|
|
453 |
"return true, if the given file is readable"
|
|
454 |
|
159
|
455 |
^ OperatingSystem isReadable:(self class fullPathNameOf:name in:pathName)
|
1
|
456 |
!
|
|
457 |
|
|
458 |
isWritable:name
|
|
459 |
"return true, if the given file is readable"
|
|
460 |
|
159
|
461 |
^ OperatingSystem isWritable:(self class fullPathNameOf:name in:pathName)
|
1
|
462 |
!
|
|
463 |
|
|
464 |
isExecutable:name
|
|
465 |
"return true, if the given file is executable"
|
|
466 |
|
159
|
467 |
^ OperatingSystem isExecutable:(self class fullPathNameOf:name in:pathName)
|
1
|
468 |
! !
|
|
469 |
|
|
470 |
!FileDirectory methodsFor:'printing & storing'!
|
|
471 |
|
|
472 |
printString
|
|
473 |
lazy ifTrue:[self getFullPathName].
|
|
474 |
^ '(a FileDirectory pathName:' , pathName, ')'
|
|
475 |
!
|
|
476 |
|
|
477 |
storeOn:aStream
|
|
478 |
lazy ifTrue:[self getFullPathName].
|
|
479 |
aStream nextPutAll:'(FileDirectory directoryNamed:'.
|
|
480 |
aStream nextPutAll:pathName.
|
|
481 |
aStream nextPut:$)
|
|
482 |
! !
|
|
483 |
|
|
484 |
!FileDirectory methodsFor:'more instance creation'!
|
|
485 |
|
|
486 |
directoryNamed:aName
|
|
487 |
^ self class directoryNamed:aName in:self pathName
|
|
488 |
! !
|
|
489 |
|
|
490 |
!FileDirectory methodsFor:'enumerating'!
|
|
491 |
|
|
492 |
where:testBlock do:aBlock
|
|
493 |
"evaluate the argument, aBlock for every object in the directory
|
|
494 |
for which testBlock evaluates to true."
|
|
495 |
|
|
496 |
|aStream name|
|
|
497 |
|
|
498 |
aStream := DirectoryStream directoryNamed:pathName.
|
|
499 |
aStream isNil ifTrue:[^ nil].
|
|
500 |
[aStream atEnd] whileFalse:[
|
|
501 |
name := aStream nextLine.
|
|
502 |
name notNil ifTrue:[
|
|
503 |
(testBlock value:name) ifTrue:[
|
|
504 |
aBlock value:name
|
|
505 |
]
|
|
506 |
]
|
|
507 |
].
|
|
508 |
aStream close
|
|
509 |
!
|
|
510 |
|
|
511 |
do:aBlock
|
|
512 |
"evaluate the argument, aBlock for every name in the directory"
|
|
513 |
|
|
514 |
self where:[:name | true] do:aBlock
|
|
515 |
!
|
|
516 |
|
|
517 |
namesDo:aBlock
|
|
518 |
"evaluate the argument, aBlock for every name in the directory.
|
|
519 |
for ST-80 compatibility"
|
|
520 |
|
|
521 |
self do:aBlock
|
|
522 |
!
|
|
523 |
|
|
524 |
filesDo:aBlock
|
|
525 |
"evaluate the argument, aBlock for every plain file name in the directory"
|
|
526 |
|
|
527 |
self where:[:name | (self isDirectory:name) not] do:aBlock
|
|
528 |
!
|
|
529 |
|
|
530 |
directoriesDo:aBlock
|
|
531 |
"evaluate the argument, aBlock for every subdirectory name in the directory"
|
|
532 |
|
|
533 |
self where:[:name | (self isDirectory:name) ifTrue:[
|
|
534 |
((name ~= '.') and:[name ~= '..'])
|
|
535 |
] ifFalse:[
|
|
536 |
false
|
|
537 |
]
|
|
538 |
] do:aBlock
|
|
539 |
!
|
|
540 |
|
|
541 |
allFilesDo:aBlock
|
|
542 |
"evaluate the argument, aBlock for every file name in the directory and in all
|
|
543 |
subdirectories"
|
|
544 |
|
|
545 |
|aStream command line|
|
|
546 |
|
|
547 |
lazy ifTrue:[self getFullPathName].
|
|
548 |
command := 'cd ' , pathName , '; find . -print'.
|
|
549 |
aStream := PipeStream readingFrom:command.
|
|
550 |
aStream isNil ifTrue:[^ nil].
|
|
551 |
[aStream atEnd] whileFalse:[
|
|
552 |
line := aStream nextLine.
|
|
553 |
line notNil ifTrue:[
|
|
554 |
(line = '.') ifFalse:[
|
|
555 |
"cut off initial ./"
|
54
|
556 |
line := line copyFrom:3
|
1
|
557 |
].
|
|
558 |
aBlock value:line
|
|
559 |
]
|
|
560 |
].
|
|
561 |
aStream close
|
|
562 |
!
|
|
563 |
|
|
564 |
allDirectoriesDo:aBlock
|
|
565 |
"evaluate the argument, aBlock for every directory name
|
|
566 |
in the directory and in all subdirectories"
|
|
567 |
|
|
568 |
|aStream command line|
|
|
569 |
|
|
570 |
lazy ifTrue:[self getFullPathName].
|
|
571 |
command := 'cd ' , pathName , '; find . -type d -print'.
|
|
572 |
aStream := PipeStream readingFrom:command.
|
|
573 |
aStream isNil ifTrue:[^ nil].
|
|
574 |
[aStream atEnd] whileFalse:[
|
|
575 |
line := aStream nextLine.
|
|
576 |
line notNil ifTrue:[
|
|
577 |
(line = '.') ifFalse:[
|
|
578 |
"cut off initial ./"
|
54
|
579 |
line := line copyFrom:3
|
1
|
580 |
].
|
|
581 |
aBlock value:line
|
|
582 |
]
|
|
583 |
].
|
|
584 |
aStream close
|
|
585 |
! !
|