This is the mail archive of the
mailing list for the Cygwin project.
RE: Install 1.3.22-1 problem - default text file type - DOS
- From: Francis Harvey <HARVEYF1 at WESTAT dot com>
- To: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>
- Cc: "'pechtcha at cs dot nyu dot edu'" <pechtcha at cs dot nyu dot edu>
- Date: Tue, 5 Aug 2003 14:43:18 -0400
- Subject: RE: Install 1.3.22-1 problem - default text file type - DOS
Thanks. I have now replaced \n with \r\n every place I used \n in a
character string. I have made sure not to switch the single character
when used separately from a string. Everything appears to work fine
Francis R. Harvey III
VB programmers know the wisdom of Nothing
> -----Original Message-----
> From: Igor Pechtchanski [mailto:email@example.com]
> Sent: Tuesday, August 05, 2003 12:55 PM
> To: Francis Harvey
> Cc: firstname.lastname@example.org
> Subject: Re: Install 1.3.22-1 problem - default text file type - DOS
> I think you misunderstood what the "text" (or DOS) mode
> means. Mounting
> in the "text" mode allows the files *on disk* to have the
> "\r\n" newline
> sequence which will be translated to "\n" upon reading the
> file in default
> mode (i.e., make the default mode "text"), and the reverse translation
> would happen on writing. Mounting in binary mode does not perform any
> character translation for default open()s, so you'll actually
> see the "\r"
> characters in your program. Of course, you can always override this
> setting with "rt" for text and "rb" for binary...
> What your program is doing is something completely different. The C
> language specification says that the '\n' character
> represents the ASCII
> value of NL, or 10. The '\r' character represents the ASCII
> value of CR,
> or 13. This won't ever be changed by the mount mode (or the "binmode"
> setting in the CYGWIN variable). The mount mode only affects
> with disk files (just like "binmode" affects interaction with pipes).
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html