tim at sumeru.stanford.edu
Tue Jan 15 18:29:58 UTC 2002
"David T. Lewis" wrote:
> Try this on the class side of the plugin (I don't have time to test it
> right now, but I think it does what you want):
> getEntry: fileName inDirectoryPath: aDirectoryPath
> "self getEntry: 'hosts' inDirectoryPath: '/etc'"
> "self getEntry: 'hosts' inDirectoryPath: '/noSuchDir'"
> "self getEntry: 'noSuchFile' inDirectoryPath: '/etc'"
> | entName |
> self primSetDirectory: aDirectoryPath.
> [(entName _ self primNextEntry) notNil]
> whileTrue: [(entName = fileName)
> [^ DirectoryEntry fromArray: (self primStat: fileName)]].
> ^ nil
That would be closer since it stops when it finds that important mpeg of
your boss harassing a colleague (useful just before payraise
discussions) but couldn't we just use something like
foo_ self primStat: filename.
foo ifNil:["didnt find file"]
More information about the Squeak-dev