This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: hybrid text/binary mount


On Tue, May 02, 2000 at 11:58:26AM +0200, schilling@fokus.gmd.de wrote:
>>From: Chris Faylor <cgf@cygnus.com>
>>On Mon, Apr 24, 2000 at 02:31:19PM -0400, DJ Delorie wrote:
>>>Hey, I've got an idea.  How about a mount mode where files opened for
>>>reading do CR/LF conversion *if* they look like text files (i.e. no
>>>binary characters, all CR/LF are part of CR/LF pair), and files open
>>>for writing always write files in binary mode.
>
>>That's amazing.  I have been thinking about the same thing for several
>>days.  I have started to type this in several time but always hit a wall
>>when I realized that given the nature of this mailing list, either no one
>>would respond or somewone will respond with a twenty page treatise on the
>>way they think it should be done with no hint of an effort to volunteer to
>>do the actual work.
>
>>I was thinking that if a file had any characters whose ASCII code was
>>< ' ' or >= DEL before the first \n, then the file would be considered
>>binary.  Otherwise, the file would be text.  You could apply this heuristic
>>to both input and output.
>
>This may have been true 15 years ago.....
>
>A file is binary, if it contains non-printable characters. 
>
>As we may have e.g umlauts in 8 bit things have changed.

I didn't mean to imply that it was foolproof.  Obviously this would only
work for US users.  There is no simple heuristic that will work with characters
above 127.

It doesn't matter anyway.  This technique is so random that we shouldn't use it.

I like the default "write binary"/"read text" idea better.

cgf

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]