Subject: RE: Install 1.3.22-1 problem - default text file type - DOS
From: Francis Harvey <[email-masked]>
To: "[email-masked]'" <[email-masked]>
Cc: "[email-masked]'" <[email-masked]>
Date: Tue, 5 Aug 2003 14:43:18 -0400

Greetings Igor,

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
now.

Francis R. Harvey III
WB303, x3952
[email-masked]

VB programmers know the wisdom of Nothing

> -----Original Message-----
> From: Igor Pechtchanski [mailto:[email-masked]] 
> Sent: Tuesday, August 05, 2003 12:55 PM
> To: Francis Harvey
> Cc: [email-masked]
> Subject: Re: Install 1.3.22-1 problem - default text file type - DOS
> 
<snip>
> 
> 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 
> interaction
> with disk files (just like "binmode" affects interaction with pipes).
> 	Igor
<snip>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/