Using LF in fileOut's

Bert Freudenberg bert at impara.de
Fri Mar 12 10:43:18 UTC 2004


Am 12.03.2004 um 10:01 schrieb Ragnar Hojland Espinosa:

> On Thu, Mar 11, 2004 at 08:02:30PM -0800, tim Rowledge wrote:
>> C. David Shaffer wrote:
>>> Vincent wrote:
>>>
>>>> Hi,
>>>>
>>>> I work with MacOS X and Linux.  When I do fileOut on a class or 
>>>> method,
>>>> I always need to convert eh CR line-endings with LF line-endings.  
>>>> Is
>>>> there a way to have fileOut use Character lf instead of cr?
>>>>
>> Fileouts are expected to be CR line-ended. That's just the way it is.
>> Treat them as binary data.
>
> For any particular reason, or they just are?

The changes and sources files indeed have to be treated as binary data, 
because each chunk in them is indexed from the image with absolute file 
offsets. They would work equally well with LF as line ending (not CRLF 
because that's 2 bytes), but CRs tend to make more problems on other 
platforms because it is less common. This is a Good Thing, because it 
reminds you of treating them as binary.

However, IMHO, filed-out changesets are text, and we should be smart 
about the line ending there. This can be accomplished by using 
CrLfFileStreams for file-outs and file-ins.

- Bert -




More information about the Squeak-dev mailing list