delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/01/12/15:02:39

From: marcus AT bighorn DOT dr DOT lucent DOT com
Subject: Re: Why text=binary mounts
12 Jan 1998 15:02:39 -0800 :
Message-ID: <199801121707.KAA21388.cygnus.gnu-win32@chorus.dr.lucent.com>
To: gnu-win32 AT cygnus DOT com

?? originally wrote:
}Maybe the reading operations could track what kind of
}line termination is being used on a file, then succeeding write operations
}could use the same style (unless overridden by the open() flags)?  That
}sounds weird...and probably unworkable...just food for thought.

"Larry Hall (RFK Partners Inc)" <lhall AT rfk DOT com> writes:
> Not necessarily.  Various programs do this, including vim and, I think,
>NTEmacs.

So long as the program knows that it is a text file (or that it is going
to treat it as such), then it could just as easily pass some indication of
that to the {f}open() routine.  Given a reliable indication of text/binary
content of a file, cygwin32 could do a fine job of translating line endings
from the native system to the \n termination expectation of the program.

The problem, though, seems to be in getting all the programs to reliably
pass this information to the {f}open() call, so cygwin32 does not know
if the file is binary or not.

Trying to tell which of several likely line endings is used in a file is
not too difficult, once you know it is a text file.  Trying to tell if
it is a text file or a binary file, however, is not nearly so easy.

marcus hall
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019