Matthew Fulmer uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-mtf.81.mcz==================== Summary ====================
Name: Files-mtf.81
Author: mtf
Time: 1 June 2010, 6:51:26.183 pm
UUID: 3f837337-fd86-42eb-9c46-f5f9adf7f10a
Ancestors: Files-ul.80
Refactored directory scanning based on a method that was part of Tweak
=============== Diff against Files-ul.80 ===============
Item was changed:
----- Method: FileDirectory>>directoryContentsFor: (in category 'private') -----
directoryContentsFor: fullPath
"Return a collection of directory entries for the files and directories in the directory with the given path. See primLookupEntryIn:index: for further details."
"FileDirectory default directoryContentsFor: ''"
^Array new: 200 streamContents: [:stream |
+ self directoryContentsFor: fullPath do: [:ea | stream nextPut: ea]].!
- | f entryArray index |
- f := fullPath asVmPathName.
- index := 1.
- [(entryArray := self primLookupEntryIn: f index: index) == nil] whileFalse: [
- . #badDirectoryPath = entryArray ifTrue: [
- ^(InvalidDirectoryError pathName: pathName asSqueakPathName) signal].
- index := index + 1.
- stream nextPut: (DirectoryEntry fromArray: entryArray directory: self) convertFromSystemName]].!
Item was added:
+ ----- Method: FileDirectory>>directoryContentsFor:do: (in category 'private') -----
+ directoryContentsFor: fullPath do: aBlock
+ "Do aBlock for the files and directories in the directory with the given path. See primLookupEntryIn:index: for further details."
+
+ | f entryArray index |
+ f := fullPath asVmPathName.
+ index := 1.
+ [(entryArray := self primLookupEntryIn: f index: index) == nil] whileFalse: [
+ #badDirectoryPath = entryArray ifTrue: [
+ ^(InvalidDirectoryError pathName: pathName) signal].
+ index := index + 1.
+ aBlock value: (DirectoryEntry fromArray: entryArray directory: self) convertFromSystemName]!