[BUG] Problem creating FileStream on Macs?

Mark Guzdial guzdial at cc.gatech.edu
Mon May 24 15:19:20 UTC 1999


>  It seems to me that the following statement:
>----------------------
>(StandardFileStream isAFileNamed: fileName) ifTrue:
>	[^ StandardFileStream new open: fileName forWrite: aBoolean].
>----------------------
>is considered to be an "idiom" to open a file without fail.
>However, what isAFileNamed: does is to try to open a file
>with open:forWrite: and to see the result (and close), and
>virtually, the result is unpredictable.

On the Mac, it's possible for the test in the above statement to work, but
the actual open to fail.  If you open files without closing them (say, in
debugging code), that isAFileNamed: may eat up the last file handler --
it'll work, but the second one won't.

Mark

--------------------------
Mark Guzdial : Georgia Tech : College of Computing : Atlanta, GA 30332-0280
(404) 894-5618 : Fax (404) 894-0673 : guzdial at cc.gatech.edu
http://www.cc.gatech.edu/gvu/people/Faculty/Mark.Guzdial.html





More information about the Squeak-dev mailing list