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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Tim Patti
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.

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.

Tim Patti




Reply | Threaded
Open this post in threaded view
|

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

Bert Freudenberg

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 -



Reply | Threaded
Open this post in threaded view
|

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

johnmci
In reply to this post by Tim Patti
Although this was classified as a beginner question and answered, I'll  
note that InterpeterSupportCode writeSupportFiles no longer works with  
current image or likely in any image made in the last 5 years or so,  
perhaps even longer.

The process to load the VM code starts with http://www.squeaksource.com/VMMaker.html
and the SVN directory at http://www.squeakvm.org/cgi-bin/viewcvs.cgi
Also see platform api thoughts at  http://isqueak.org/PlatformVMAPI

Lastly if you were desperate and *really* wanted to see where the  
fopen happened then it's at
http://www.squeakvm.org/cgi-bin/viewcvs.cgi/trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c?rev=1930&view=auto



On 17-Jun-09, at 3:56 AM, 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.
>
> 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.
>
> Tim Patti
>
>
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>   Twitter:  
squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================