newbie: nice text file

Ned Konz ned at bike-nomad.com
Wed May 2 20:33:57 UTC 2001


On Wednesday 02 May 2001 10:21, Brent Pinkney wrote:
> Hi,
>
> According to Adreas Raab on 10 July 1997 in message 9707 to this list
> (Google is amazing)
>
> 1. Change FileStream class>>concreteStream to return CrLfFileStream.
>
> Now to work and save your code in a file stream, recall that all text areas
> in Sqeauk can be used to excute code.
>
> 2. Using the file list create a new file, say doit.st.
> 3. Open the file using the file open menu. This will open a new purple
> window with the contents of your file. This looks similar to a workspace.
> 4. Edit text, inspect, display etc to your hearts content.
> 5. To save, use alt-s (cmd-s on Mac ?)
> 6. Squeak will prompt you to overwrite doit.st. Alas I have not
> investigated how to remove this prompt.
>
> This file can now be opened with a conventional DOS editor like notepad and
> the contents have the expected CRLF newlines.
>
> Note. If you use the 'view as hex' menu option in the file viewer, you will
> only see the 0d (CR). The CRLFFileStream strip the LF off when reading and
> inserts it when writing the file. Smart stuff.

There are some potential problems with changing the default file stream type. 
Some things in the system do not (or at least have not in the past) properly 
set the stream mode to binary, and so you can get extra, unwanted line ending 
characters in what were supposed to be binary files.

Some time ago I made a change set that fixed most of these problems, but I 
haven't kept it updated with the latest 3.1 stuff.

It's attached for your amusement. This was working in 3.1alpha, change set 
3696, as of 25 Feburary. It will probably need to be changed for the current 
version.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FixConcreteStream-nk.1.cs.gz
Type: application/x-gzip
Size: 4809 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010502/dc61fb77/FixConcreteStream-nk.1.cs.bin


More information about the Squeak-dev mailing list