Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
To: "'cygwin@cygwin.com'" <cygwin@cygwin.com>
Subject: Re: File streams in C++
References: <696BDC661BFCD411A8C90002A509489616DA3C@bndkcopmex01.barconet.com>
From: Benjamin Riefenstahl <Benjamin.Riefenstahl@ision.net>
In-Reply-To: "Schultz, Jacob"'s message of "Fri, 20 Apr 2001 09:58:45 +0200"
User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7
Date: 20 Apr 2001 16:59:46 +0200
Message-ID: <ud7a7ehwd.fsf@work1.work.maz.net>
Lines: 32
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Hi Jacob,


"Schultz, Jacob" <Jacob.Schultz@barconet.com> writes:
>   stream.open ("test.txt");
>   [...]
>   file = fopen ("test.txt","r");
> 
Your code opens the file in text mode. 

>  <<test.txt>> 

Your file is not a text file (despite the name). 

Look into your favorite C++ tutorial or reference on how to open files
in binary mode.  If it doesn't talk about this distinction, throw it
away and get a better book.

In addition you may want to look at the cygwin FAQ at
http://www.cygwin.com/faq/.  I just checked and the entry "How is the
DOS/Unix CR/LF thing handled?" applies.


so long, benny
-- 
ISION Internet AG
Benjamin Riefenstahl
mailto:benjamin.riefenstahl@ision.net

Harburger Schlossstr. 1
D-21079 Hamburg
http://www.ision.net


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

