[Q]: Opening a file on Win2000 - Squeak 2.4g/2.5a
Thierry Reignier
thierry_reignier at hotmail.com
Tue Jan 14 08:51:03 UTC 2003
Hi,
I need to open a file and I do it with:
fileStream _ FileStream fileNamed: 'C:\Squeak\OUTWREC-4-0.rtf'.
ReadStream on: fileStream contentsOfEntireFile
...
It works fine but atfer some time I get a debugger complaining:
MessageNotUnderstood: contentsOfEntireFile
VM: Win32 - Squeak3.3alpha of 24 January 2002 [latest update: #4967]
Image: Squeak3.5alpha [latest update: #5168]
1. Could it be that GC causes trouble? since FileStream is nil.
StandardFileStream>>open: fileName forWrite: writeMode
"Open the file with the given name. If writeMode is true, allow
writing, otherwise open the file in read-only mode."
"Changed to do a GC and retry before failing ar 3/21/98 17:25"
fileID _ StandardFileStream retryWithGC:[self primOpen: fileName
writable: writeMode]
until:[:id| id notNil]
forFileNamed: fileName.
fileID ifNil: [^ nil]. "allows sender to detect failure"
...
2. Or could it be that I am missing the FilePlugin mentioned in
StandardFileStream>>primOpen: fileName writable: writableFlag
"Open a file of the given name, and return the file ID obtained.
If writableFlag is true, then
if there is none with this name, then create one
else prepare to overwrite the existing from the beginning
otherwise
if the file exists, open it read-only
else return nil"
<primitive: 'primitiveFileOpen' module: 'FilePlugin'>
^ nil
(same happens in 3.4g)
Thanks
Thierry
_________________________________________________________________
The new MSN 8 is here: Try it free* for 2 months
http://join.msn.com/?page=dept/dialup
More information about the Squeak-dev
mailing list
|