🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52914

problem with is_open in gcc 2.0

#52914
From: santhi karunanithi
Date: Sun, 03 May 1992 18:04
25 lines
1205 bytes
Hi,

I am using g++ 2.0. I am using fstream class to use a file.

Problem1:
--------
For example,
 fstream myfile ("a.file",ios::in|ios::nocreate);
 if (!myfile.is_open()) // do something;

In some programs, i do not get compilation error and in some
programs i get no fstream::is_open error. Even if i do not
get compilation error, the system hangs. Can some one suggest
some solution?.

Problem2:
---------
while (!myfile.eof()) {myfile >> a;}

goes in a loop. It is not sensing eof. For this also, i need
some suggestion.

Thank you,
Santhi.
Email: karunans@cs.colostate.edu
Technical Details
Message-ID: <9205031804.AA07984@beethoven>
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.colostate.EDU!karunans

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,12b68b39aab008e0
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-05-03 11:04:56 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.colostate.EDU!karunans
From: karunans@cs.colostate.EDU (santhi karunanithi)
Subject: problem with is_open in gcc 2.0
Message-ID: <9205031804.AA07984@beethoven>
Sender: daemon@cis.ohio-state.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sun, 3 May 1992 18:04:56 GMT
Lines: 25