[squeak-dev] FileStream lack of binary support on microsoft windows.

Bert Freudenberg bert at freudenbergs.de
Wed Jun 17 11:25:49 UTC 2009


On 17.06.2009, at 12:56, Tim Patti wrote:

> HI all,
>
> I have a code snippet that works on my mac but not on windows:
>
> 	file := PluggableFileList getFile.
> 	fileHandle := FileStream fileNamed: file name.
> 	fileHandle binary.
>
> I'm getting a debug window with MessageNotUnderstood:  
> UndefinedObject>>binary.

Which tells you that "fileHandle" is nil.

> I've run into this before when porting C code to windows and have  
> had to use the 'b' flag with fopen() on windows.
>
> I have the book 'Squeak Open Personal Computing and Multimedia' and  
> checked out the section on porting so I could see how fopen() was  
> implemented but 'InterpeterSupportCode writeSupportFiles' doesn't  
> work on my 3.10.2-7179 image.
>  I'm interested in digging into this and would appreciate any  
> pointers to get me moving in the right direction.

Check the file permissions.

#fileNamed: opens the file in read-write mode, so you need write  
permissions to the file.

If you only intend to read from the file, use #readOnlyFileNamed:  
instead.

And please note that this level of question is better suited for our  
beginner's list:

http://lists.squeakfoundation.org/mailman/listinfo/beginners

- Bert -





More information about the Squeak-dev mailing list