[Newbies] Help me FileIn

K. K. Subramaniam subbukk at gmail.com
Mon Aug 17 03:34:48 UTC 2009


On Monday 17 Aug 2009 7:50:35 am Randal L. Schwartz wrote:
> K> On Monday 17 Aug 2009 12:17:25 am Randal L. Schwartz wrote:
> >> That explanation is about .sources and .changes, not fileOuts.
>
> K> The class fileout (from browser into *.st files) uses the same format
> K> (sequence of data chunks) as *.sources and *.changes files. Did you have
> K> some other fileOuts in mind?
>
> Are you sure?
Yes. fileOuts are binary streams, not ASCII (cf. Class>>fileOut and FileStream>> 
writeSourceCodeFrom:.....).
> It looks like the fileout I just got is classic ST-80 format, with "!"
> delimiting Smalltalk code.  There's no "binary" data in here... it's all
> human-readable text (chunks of smalltalk code).  That's different from the
> .sources and .changes, because they have some binary data in them (I
> thought).
I made the same mistake a few years back. Just because a byteArray contains 
readable text does not mean that it is becomes a string. Text is not portable 
across platforms because of different line-ending conventions. If line 
conversions are done on fileOut before filing in then any string literals with 
newlines will get corrupted.

Subbu


More information about the Beginners mailing list