[BUG] FileDIrectory>isAFileNamed: considered vile

David T. Lewis lewis at mail.msen.com
Mon Aug 4 09:35:32 UTC 2003


On Fri, Aug 01, 2003 at 05:15:25PM -0700, Tim Rowledge wrote:
> I mean yuck. Blech.
> 
> Testing for the existence of a file by trying to open it? OK, if one is
> utterly restricted to only the support guaranteed in a an ansi library
> maybe we can make an excuse.
> 
> Time to extend the FilePlugin a bit. Old images on new VMs would
> continue to sin as usual. New image on old VM would fail the prim and
> sin for punishment. New image on new VM would do The Right Thing. 
> 
> tim
> --
> Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
> Useful random insult:- An expert on the historical significance of cottage cheese.

This was one of the things I addressed in DirectoryPlugin. I won't claim
it as a proper fix, but it certainly made some things much faster on
Unix and Win32 (it helps Unix more).

The strategy is to stat() the file rather than test it with an open(). If
the stat() can't be done (ie if the plugin does not exist), the default
open() strategy is used.

In addition to a plugin that claims to improve directory stream access,
there is some judicious hacking on FileDirectory, StandardFileStream class,
and UnixFileDirectory, including FileDirectory>>isAFileNamed: and
FileDirectory>>isAFileNamed:.

It's not on SM, but you can get it at <http://minnow.cc.gatech.edu/squeak/2274>.
Last tested on Squeak 3.2, but most likely will work on 3.6.
Someone would need to do the RiscOS support (and Mac OS).

I guess I should put this on SM.

Dave




More information about the Squeak-dev mailing list