delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/03/11:31:25

Newsgroups: comp.os.msdos.djgpp
From: manfred DOT heumann AT uni-bielefeld DOT de (Manni Heumann)
Subject: Re: ifstream problems
References: <377D3159 DOT 2FB4AF41 AT dallas DOT crosswinds DOT net>
X-Newsreader: News Xpress 2.01
Date: Sat, 03 Jul 1999 10:26:13 GMT
NNTP-Posting-Host: ppp36-10.hrz.uni-bielefeld.de
Message-ID: <377de546.0@news.uni-bielefeld.de>
X-Trace: 3 Jul 1999 12:26:14 +0200, ppp36-10.hrz.uni-bielefeld.de
Lines: 32
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <377D3159 DOT 2FB4AF41 AT dallas DOT crosswinds DOT net>, perdita AT dallas DOT crosswinds DOT net wrote:
>I am already at the end of my wits.
>
>I have been attempting to write a function to open an AVI file. 
>However, I have had this particular aggravation which is stopping me.
>
>I open the file by using
>
>ifstream("mmm.avi",ios::binary);
>
>However, I cannot even read anything!  Anything I test for EOF (using
>ifstream::eof()) it reports that the EOF is at the beginning of the
>file, and the location of the pointer at the stream is zero!
>
>What is even more strange is that if I open the file as text, it works
>perfectly.
>
>Any suggestions? (I can't post my code here because it is in a mess.)
>
>
You will have to change 
ifstream ("mmm.avi", ios::binary);
to 
ifstream your_name_for_this_object ("mmm.avi", ios::binary | ios::in);

If you need any other flags just add them with another or (|).


--

Manni

- Raw text -


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