Walk a directory/Recursively: Difference between revisions

m
→‎{{header|Smalltalk}}: several bug fixes that prevented the full deep exploration
m (→‎{{header|Smalltalk}}: sorted instead of ordered)
m (→‎{{header|Smalltalk}}: several bug fixes that prevented the full deep exploration)
Line 466:
cont remove: '.'; remove: '..'.
cont
do: [ :n | |fn ps|
ps := (Directory pathSeparator) asString.
fn := (self name), ps, n.
((File name: fn) isDirectory)
ifTrue: [
twoBlock value: (fnn, '/'ps) value: l.
(Directory name: fn) wholeContent: aPattern withLevel: (l+1) do: twoBlock.
]
ifFalse: [
( fnn =~ aPattern )
ifMatched: [ :m |
twoBlock value: fnn value: l
]
]
Line 484 ⟶ 486:
<lang smalltalk>|d|
d := Directory name: '.'.
d wholeContent: '\.st$' do: [ :f :l |
0 to: l do: [ :i | (Character tab) display ].
f displayNl