From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5904 invoked by alias); 8 Jul 2002 17:46:07 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 5864 invoked by uid 71); 8 Jul 2002 17:46:02 -0000 Resent-Date: 8 Jul 2002 17:46:02 -0000 Resent-Message-ID: <20020708174602.5862.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Andrea Latina Received: (qmail 1863 invoked from network); 8 Jul 2002 17:39:05 -0000 Received: from unknown (HELO to427xl.to.infn.it) (192.84.147.73) by sources.redhat.com with SMTP; 8 Jul 2002 17:39:05 -0000 Received: (from latina@localhost) by to427xl.to.infn.it (8.11.6/8.11.6) id g68HtAB02785; Mon, 8 Jul 2002 19:55:10 +0200 Message-Id: <200207081755.g68HtAB02785@to427xl.to.infn.it> Date: Mon, 08 Jul 2002 10:46:00 -0000 From: Andrea Latina To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: c++/7235: iostream bug: cannot re-read a file. X-SW-Source: 2002-07/txt/msg00248.txt.bz2 List-Id: >Number: 7235 >Category: c++ >Synopsis: If I open twice a file, I'm not able to read anything from it. >Confidential: no >Severity: serious >Priority: high >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Jul 08 10:46:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Andrea Latina >Release: 3.1 >Organization: >Environment: System: Linux to427xl.to.infn.it 2.4.18-5smp #1 SMP Mon Jun 10 15:19:40 EDT 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc-3.1/configure --enable-threads >Description: When I close a file previously opened, then I reopen it, I'm not able to read anything from the file. >How-To-Repeat: I report the code exploiting the error: #include #include using namespace std; int main() { ifstream file("dati"); if (file) { int x, y; while(file >> x >> y) cout << x << '\t' << y << endl; file.close(); file.open("dati"); // the following line fails! while(file >> x >> y) cout << x << '\t' << y << endl; } return 0; } where "dati" is a ascii file, like this: 10 10 20 20 for example. >Fix: >Release-Note: >Audit-Trail: >Unformatted: