This is the mail archive of the 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]
Other format: [Raw text]

RE: Install 1.3.22-1 problem - default text file type - DOS

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

Francis R. Harvey III
WB303, x3952

VB programmers know the wisdom of Nothing

> -----Original Message-----
> From: Igor Pechtchanski [] 
> Sent: Tuesday, August 05, 2003 12:55 PM
> To: Francis Harvey
> Cc:
> 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 
> interaction
> with disk files (just like "binmode" affects interaction with pipes).
> 	Igor

Unsubscribe info:
Problem reports:

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