This is the mail archive of the cygwin@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: Why text=binary mounts (Re: Gnu-win32 (b18), coolview and NTEmacs)


"Jeffrey C. Fried" <jcfried@ix.netcom.com> writes:

> from both operating systems under NT/95.  For examples of this
> compatibility look at many of the GNU tools which handle text, the file
> handling will work under both operating systems without any change because
> they use text mode I/O which is platform independent once all files have
> been converted to the form of the native OS.

A problem is that the open() call in MS-land has a binary/text mode flag,
but Unix open() calls generally don't (since there is typically no
binary/text mode distinction made).  So, you always end up having
problems with porting arbitrary Unix code over to MS-land when the Unix
code calls open() without specifying a mode AND the default mode doesn't
match what the Unix code was expecting.

Part of the problem with specifying the default text file type on a
per-mount basis is that it frequently isn't the right basis for specifying
it.  I may have mounts where I want both style of line termination - maybe
it's more related to what kind of file I'm writing.  Using the mount point
is kind of a best guess heuristic, I guess.  What we need is omniscent
software that just knows what I want and does it :-)).

Maybe it'd be nice of the mount mode were irrelevant when reading an
existing file, but just controlled what happens when you write a file to
the file system.  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.

How do the MS-land programs that understand both line terminations work?
They probably just accept either on input, then do \r\n on output, right?

Oh, Idunno...
-- 
Scott Blachowicz                <sab@seanet.com>

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


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