[Newbies] Re: Re: reading lines from textfiles on Linux

Klaus D. Witzel klaus.witzel at cobss.com
Wed May 17 03:18:39 UTC 2006


Hi Charles,

on Wed, 17 May 2006 03:21:36 +0200, you <charleshixsn at earthlink.net> wrote:

> Klaus D. Witzel wrote:
>> When you use the Squeak File List
>> browser (alt-L or ctrl-L with capital L) and view your file and then
>> in the text pane's context menue ask for 'view as hex', can you
>> confirm that this Smalltalk program can see and visualize your line  
>> ends?
> It appears to be 16r10.  I'm not exactly sure, as I'm not used to
> reading hex this way, so here's the first little part:
> 16r0 (0)     16r27 16r69 16r74 16r65 16r6D 16r73 16r27 16r9 16r9 16r9
> 16r9 16r9 16r9 16rA 16r27 16r69
> 16r10 (16)     16r64 16r27 16r9 16r27 16r6E 16r61 16r6D 16r65 16r27 16r9
> 16r27 16r63 16r6F 16r73 16r74 16r27
> 16r20 (32)     16r9 16r27 16r74 16r79 16r70 16r65 16r27 16r9 16r27 16r70
> 16r6F 16r77 16r65 16r72 16r27 16r9
> that should include at least one line.  (The first line is the word
> 'technology'  including the quotes, followed by a line feed.)

This is not output of the File List tool. And there are many 16r9's before  
the line feed and, the word technology is a bit longer than 5 characters.

...

> The part that still bothers me is why when I set the mode to ascii (I
> think that was what I was doing) executing a position: would throw an
> error.  Also executing a reset.  Also executing a reopen.  (At that
> point I was operating under the presumption that perhaps
> detectLineEndConvention was filling the buffer, and then the first read
> emptied the whole thing, so I was trying to rewind the file to avoid
> that problem.)  This part no longer exists in any code that I've kept,
> but it is nagging at me.

Here are two examples, both have the same result, and both do not throw an  
error as you described:

(StandardFileStream readOnlyFileNamed: 'Squeak.ini')next; reset; next;  
reopen; next

(CrLfFileStream readOnlyFileNamed: 'Squeak.ini')next; reset; next; reopen;  
next

You can copy&paste&evaluate with print-it, the file should be the same on  
your machine.

/Klaus



More information about the Beginners mailing list