public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/5629: fstream class is unable to create file in a read/write mode
@ 2002-02-07 14:26 apakhomov
  0 siblings, 0 replies; 4+ messages in thread
From: apakhomov @ 2002-02-07 14:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5629
>Category:       libstdc++
>Synopsis:       fstream class is unable to create file in a read/write mode
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 07 14:26:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Alex Pakhomov, Secant Technologies
>Release:        gcc 3.0.3
>Organization:
>Environment:
Red Hat 6.2, kernel 2.2.14 on i686
>Description:
The fstream class when created in "ios::in|ios::out" mode does not create a file. Works OK when compiled w/gcc 2.95.3
>How-To-Repeat:
Compile the attached file, run the binary and see if there is "test.tmp" file containing "This is a test" line appears in the current directory
>Fix:
?
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libstdc++/5629: fstream class is unable to create file in a read/write mode
@ 2002-02-07 15:35 paolo
  0 siblings, 0 replies; 4+ messages in thread
From: paolo @ 2002-02-07 15:35 UTC (permalink / raw)
  To: apakhomov, gcc-bugs, gcc-prs, paolo

Synopsis: fstream class is unable to create file in a read/write mode

State-Changed-From-To: feedback->closed
State-Changed-By: paolo
State-Changed-When: Thu Feb  7 15:35:50 2002
State-Changed-Why:
    Not a bug. v3's iostreams are much more conforming to the
    standard and according to the latter in|out corresponds
    to C's "r+" (i.e., file *must* exist). Use open mode out
    to create the file. That is:
    #include <fstream>
    #include <unistd.h>
    using namespace std;
    
    int main()
    {
        char text[256];
        fstream* fs = new fstream("test.tmp",ios::out);
        strcpy(text,"This is a test\n");
        fs->write(text,strlen(text));
        fs->close();
        delete fs;
    }
    
    P.S. For further details see, f.i., Josuttis, p 631-634.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5629


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libstdc++/5629: fstream class is unable to create file in a read/write mode
@ 2002-02-07 15:26 Alex Pakhomov
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Pakhomov @ 2002-02-07 15:26 UTC (permalink / raw)
  To: paolo; +Cc: gcc-prs

The following reply was made to PR libstdc++/5629; it has been noted by GNATS.

From: "Alex Pakhomov" <apakhomov@secant.com>
To: <paolo@gcc.gnu.org>, <apakhomov@secant.com>, <gcc-bugs@gcc.gnu.org>,
        <gcc-prs@gcc.gnu.org>, <nobody@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: libstdc++/5629: fstream class is unable to create file in a read/write mode
Date: Thu, 7 Feb 2002 18:17:03 -0500

 Hi Paolo,
 
 Here is the missing code:
 
 #include <fstream>
 #include <unistd.h>
 using namespace std;
 
 int main()
 {
     char text[256];
     fstream* fs = new fstream("test.tmp",ios::out|ios::in);
     strcpy(text,"This is a test\n");
     fs->write(text,strlen(text));
     fs->close();
     delete fs;
 }
 
 Thanks.
 
 -Alex
 ----- Original Message -----
 From: <paolo@gcc.gnu.org>
 To: <apakhomov@secant.com>; <gcc-bugs@gcc.gnu.org>; <gcc-prs@gcc.gnu.org>;
 <nobody@gcc.gnu.org>; <paolo@gcc.gnu.org>
 Sent: Thursday, February 07, 2002 5:49 PM
 Subject: Re: libstdc++/5629: fstream class is unable to create file in a
 read/write mode
 
 
 > Synopsis: fstream class is unable to create file in a read/write mode
 >
 > Responsible-Changed-From-To: unassigned->paolo
 > Responsible-Changed-By: paolo
 > Responsible-Changed-When: Thu Feb  7 14:49:35 2002
 > Responsible-Changed-Why:
 >     Analyzed.
 > State-Changed-From-To: open->feedback
 > State-Changed-By: paolo
 > State-Changed-When: Thu Feb  7 14:49:35 2002
 > State-Changed-Why:
 >     For some reason, the attachments got lost. Could you please
 >     provide them?
 >     Thanks, Paolo.
 >
 >
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=5629
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libstdc++/5629: fstream class is unable to create file in a read/write mode
@ 2002-02-07 14:49 paolo
  0 siblings, 0 replies; 4+ messages in thread
From: paolo @ 2002-02-07 14:49 UTC (permalink / raw)
  To: apakhomov, gcc-bugs, gcc-prs, nobody, paolo

Synopsis: fstream class is unable to create file in a read/write mode

Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Thu Feb  7 14:49:35 2002
Responsible-Changed-Why:
    Analyzed.
State-Changed-From-To: open->feedback
State-Changed-By: paolo
State-Changed-When: Thu Feb  7 14:49:35 2002
State-Changed-Why:
    For some reason, the attachments got lost. Could you please
    provide them?
    Thanks, Paolo.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5629


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-02-07 23:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-07 14:26 libstdc++/5629: fstream class is unable to create file in a read/write mode apakhomov
2002-02-07 14:49 paolo
2002-02-07 15:26 Alex Pakhomov
2002-02-07 15:35 paolo

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).