Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com content-class: urn:content-classes:message Subject: RE: GCC program always opening files in text mode MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 23 Mar 2002 01:53:12 +1100 Message-ID: X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Robert Collins" To: , Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g2MEuF729194 > -----Original Message----- > From: Isaac DOT Pacht AT smed DOT com [mailto:Isaac DOT Pacht AT smed DOT com] > Sent: Saturday, March 23, 2002 1:45 AM > To: cygwin AT cygwin DOT com > Subject: GCC program always opening files in text mode > > > I'm trying to open a file on windows in "text" mode (i.e., > translate LF to CR/LF on output). But no matter how I open > the file (fopen, ofstream, > std::ofstream) it outputs only LF's (unless, of course, I > output a "\r\n" pair explicitly). This is even though I am > not specifying binary mode. From the documentation I thought > these files should be opened in text mode by default. The > references I found to things like mount settings and > CYGWIN=nobinmode seem to apply only to getting standard > utilities to use text mode. What am I doing wrong? The default mode is defined by the machine's install of cygwin. So, always sepcify t or b in your mode, or O_TEXT or O_BINARY for open() calls. Rob -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/