[BUG]? FileDirectory>>directoryContentsFor:

Bijan Parsia bparsia at email.unc.edu
Thu Mar 15 22:31:00 UTC 2001


On Mon, 12 Mar 2001, Bijan Parsia wrote:
[snip]
> If #directoryContentsFor: succeeds, it returns a possible empty Array. If
> the primative #primLookupEntryIn:index: fails, it returns the symbol
> #badDirectoryPath (not an exception!). #directoryContentsFor: thereupon
> returns a Fresh, Empty OrderedCollection.
[snip]

Some further confusion.

At least on windows, I can't seem to trigger a #badDirectoryPath. If the
directoryPath passed to the primative points to a file, or is screwy, it
seems to (always) return nil. In other words, I can't see how to make the
primative fail. Alas, I don't seem to have ready access to the file
primatives' code so I have no idea what's going on.

If #primLookupEntryIn:index: never fails, then we can eliminate at least
the 
	#badDirectoryPath = entryArray
		ifTrue: [^ OrderedCollection new].
test, which, while not a lot, is confusing if it's never going to be
invoked.

It's confusing too that bad directory paths are (thus) assimilated to
empty directories. Perhaps testing for directory existence (or
coherence) should take place somewhere else. Plausible, I suppose. But if
so, this should be cleared up here.

Hmm. Quick check of a Mac 2.7 VM + image reveals that the mac prim *does*
fail. Of course, one needn't change the *primative*, one can just have the
calling method return nil on failure. That would make the platforms
consistent, at least.

Cheers,
Bijan "No niggle too small" Parsia.





More information about the Squeak-dev mailing list