A new version of File-Kernel was added to project Rio: http://www.squeaksource.com/Rio/File-Kernel-kph.21.mcz
==================== Summary ====================
Name: File-Kernel-kph.21 Author: kph Time: 11 April 2009, 11:25:58 pm UUID: edc86b5a-68d8-426a-ba73-2ca26928f0f6 Ancestors: File-Kernel-kph.18
instanciate File classes based upon extension by default
=============== Diff against File-Kernel-kph.18 ===============
Item was added: + ----- Method: FileKernel class>>classForPathWithExtension: (in category 'as yet unclassified') ----- + classForPathWithExtension: aPath + + ^ self!
Item was changed: ----- Method: FileLocalExecutive>>startAt:recursively:select:excluding:into: (in category 'executive actions') ----- startAt: aDir recursively: beRecursive select: selectBlock excluding: xList into: results
"Return a collection of rio's selected by passing the directoryEntry array to the selectBlock. The KernelRio implemetation of setStatFromEntryArray: does not populate these rios with stat data. Rio's more verbose implementation does.
This can be called with startAt: aString, but if so beRecursive must be false. See primLookupEntryIn:index: for further details."
| index entryArray entry isDir fName |
index := 1.
[ (entryArray := self primLookupEntryIn: aDir asVmPathName index: index) notNil ] whileTrue: [ #badDirectoryPath = entryArray ifTrue: [ ^ results "(InvalidDirectoryError pathName: aDir value) signal" ].
isDir := entryArray at: 4. fName := entryArray at: 1. + - (xList includes: fName) ifFalse: [ + entry := ((isDir ifTrue: [ self class dirClass ] + ifFalse: [ self class fileClass classForPathWithExtension: fName ]) - entry := ((isDir ifTrue: [ self class dirClass ] ifFalse: [ self class fileClass ]) executive: self value: aDir asString) pathJoin: fName; setStatFromDir: aDir andEntryArray:entryArray; yourself. (selectBlock value: entry) ifTrue: [ results add: entry ]. (beRecursive and: [ isDir ]) ifTrue: [ self startAt: entry recursively: beRecursive select: selectBlock excluding: xList into: results ]. ]. index := index + 1 ]. ^ results!
packages@lists.squeakfoundation.org