Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <9B501B3774931C469BCCCC021BE5372277AD58@remailnt2-re01.westat.com>
From: Francis Harvey <HARVEYF1@WESTAT.com>
To: "'cygwin@cygwin.com'" <cygwin@cygwin.com>
Cc: "'pechtcha@cs.nyu.edu'" <pechtcha@cs.nyu.edu>
Subject: RE: Install 1.3.22-1 problem - default text file type - DOS
Date: Tue, 5 Aug 2003 14:43:18 -0400 
MIME-Version: 1.0
Content-Type: text/plain

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
harveyf1@westat.com

VB programmers know the wisdom of Nothing

> -----Original Message-----
> From: Igor Pechtchanski [mailto:pechtcha@cs.nyu.edu] 
> Sent: Tuesday, August 05, 2003 12:55 PM
> To: Francis Harvey
> Cc: cygwin@cygwin.com
> 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/

