This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: Why text=binary mounts (Re: Gnu-win32 (b18), coolview and NTEmacs)
- To: "Jeffrey C. Fried" <jcfried at ix dot netcom dot com>
- Subject: Re: Why text=binary mounts (Re: Gnu-win32 (b18), coolview and NTEmacs)
- From: Scott Blachowicz <sab at seanet dot com>
- Date: 08 Jan 1998 10:34:30 -0800
- Cc: "Earnie Boyd" <earnie_boyd at hotmail dot com>, gnu-win32 at cygnus dot com
- References: <3.0.5.32.19980107214526.007caae0@popd.ix.netcom.com>
- Reply-to: sab at seanet dot com
"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".