[BUG] (FileStream isAFileNamed: '') returns true

David T. Lewis lewis at mail.msen.com
Tue Apr 23 10:45:42 UTC 2002


On Mon, Apr 22, 2002 at 10:15:39PM -0700, Ned Konz wrote:
> Oddly enough,
> 
> FileStream isAFileNamed: ''
> 
> returns true.
> This is because
> 
> StandardFileStream new open: (FileStream fullName: '') forWrite: 
> false.
> 
> returns a non-nil file. And reading from it returns empty strings (!).
> 
> There isn't a file named '' in the current directory, of course.
> 
> Recent CVS VM from SourceForge. Linux. 3.2g image.

If you use DirectoryPlugin (http://minnow.cc.gatech.edu/squeak/2196) this
will be handled less incorrectly. Well, the #isAFileNamed: part of the
problem, anyhow. The issue is due to Squeak thinking that a unix directory
file is a "file".

I added some file stat primitives in DirectoryPlugin to permit a check
for this. Possibly some of this is generic enough to be moved into FilePlugin.

Dave




More information about the Squeak-dev mailing list