public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10424: fstream open with ios_base::in|out|app always fails
@ 2003-04-16 17:46 SCampbell
  0 siblings, 0 replies; only message in thread
From: SCampbell @ 2003-04-16 17:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10424
>Category:       c++
>Synopsis:       fstream open with ios_base::in|out|app always fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 16 17:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Steven M Campbell
>Release:        gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
>Organization:
>Environment:
RedHat 8 and 9 and HPUX using gcc3.2 were tested
>Description:
This program always delivers the 'Open failed' message:

#include "iostream"
#include "fstream"
using namespace std;

int main(int argc, char **argv) {
  fstream f;
  int fd;

  f.open("myfile",ios_base::in|ios_base::out|ios_base::app);
  if (!f.is_open()) {
    cerr << "Open Failed" << endl;
    exit(255);
  }

  f.close();
  return(0);
}
>How-To-Repeat:
Run the code in the Description section, it should behave like a C 'fopen("myfile","a+")', ie, it should use an existing file or create the file if it does not exist.  Instead it always fails regardless of the presence of the test file (myfile).
>Fix:
None that I know of.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-16 17:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-16 17:46 c++/10424: fstream open with ios_base::in|out|app always fails SCampbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).