[ENH][GOODIE] UnixFileDirectoryPlugin

Tim Rowledge tim at sumeru.stanford.edu
Wed Jan 16 23:14:09 UTC 2002


"Noel J. Bergman" <noel at devtech.com> is widely believed to have written:

> > > foo_ self primStat: filename.
> > > foo ifNil:["didnt find file"]
> 
> > Yes!  And by the way, this would mean that isAFileNamed: can use it, and
> > avoid *all* worries and complexities involving garbage collection....
> 
> We'd want to add this primitive for other platforms besides *NIX.
Absolutely. Beleive it or not there are currently two ways to check for
the existence of a file:
- one works only for files and tries to open the file - failure means
file does not exist. Except of course on filing systems where files
cannot be opened mutliple times, where it might actualy mean 'file
already open'.
- the other one works by finding the entire list of files and
directories in the parent directory and scanning for the filename. This
one will pick up directories as well.

Neither is very efficient _except_ in one important way - they can work
with the very minimalist set of fileprims present in early Squeak. I
think we can do better with some thought.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
The wise person writes bomb-proof code.




More information about the Squeak-dev mailing list