delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/03/22/10:24:32

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Subject: RE: GCC program always opening files in text mode
To: cygwin AT cygwin DOT com
From: Isaac DOT Pacht AT smed DOT com
Date: Fri, 22 Mar 2002 10:07:32 -0500
Message-Id: <OFE54BAF8E.213D3085-ON85256B84.00530351@smed.com>
X-MIMETrack: Serialize by Router on Uranus/SMS(Release 5.0.8 |June 18, 2001) at 03/22/2002
10:06:46 AM
MIME-Version: 1.0

Thanks, adding "t" to fopen did help.  But how do I specify text mode for
an ofstream?





"Robert Collins" <robert DOT collins AT itdomain DOT com DOT au> on 03/22/2002 09:53:12 AM

To:   <Isaac DOT Pacht AT smed DOT com>, <cygwin AT cygwin DOT com>
cc:

Subject:  RE: GCC program always opening files in text mode




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







-------------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions 
Health Services Corporation and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding, printing, 
copying, distributing, or using such information is strictly prohibited and may 
be unlawful.  If you received this message in error, or have reason to believe 
you are not authorized to receive it, please promptly delete this message and 
notify the sender by e-mail with a copy to CSOffice AT smed DOT com.  Thank you

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019