Topic: ios_base::app


Author: "P.J. Plauger" <pjp@dinkumware.com>
Date: 1998/07/09
Raw View
Michel Michaud <Michel.Michaud@sympatico.ca> wrote in article <am_o1.66$x51.496320@news21.bellglobal.com>...
> I always thought that ios::app (now ios_base::app)
> "should" mean ios_base::out|ios_base::app, but it
> was not the case when using a fstream. My reading
> of the draft standard is that
>
>      an_fstream.open("file", ios_base::app)
>
> should simply fail, so you need to add ios_base::out.

I agree. Clause 27.8.1.2.

> But in their new book, Lippman and Lajoie give an
> example --with a comment !-- (pg.1102) :
>
>     // ios_base::out would discard current data
>     file.open("word.out", ios_base::app);
>
> Has anything changed since the draft ?

My notes indicate that the committee made some small changes in the
accepted mode bit combinations about two years ago, but not in this
area.

> In Stroustrup, we can read pg.639 that the
> actual values and their meaning are
> implementation-defined... and we should do
> experiments!

I'd say that's an overstatement of the variety permitted.

> What kind of a standard is that!
>
> I don't understand that such basic items are
> not better understood or understandable. As I
> see it, C++ could fail because of the
> standardisation... With such a big library
> it will take decades before we can write
> serious programs that can be used on all
> compiler. Or is it that nobody really use
> the streams in real program ?

You make several rash statements that charge off in several
directions.

a) The basic items you mention above are better understood
and understandable than you've been led to believe.

b) C++ *could* fail because of standardization, but I seriously
doubt that it will. Evidence to date is that the C++ Standard
is having most of its desired effect.

c) Some of us think we're already writing serious programs that
can be used on all compilers. That situation is only improving.

d) Lots of people use the streams in real programs.

Relax a little.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: "Michel Michaud" <Michel.Michaud@sympatico.ca>
Date: 1998/07/10
Raw View
>a) The basic items you mention above are better understood
>and understandable than you've been led to believe.
Thanks to you, for a better lead. But don't you believe most people
will take their lead from those books (Stroustrup, Lippman) or other
that are not even so well informed ?

>c) Some of us think we're already writing serious programs that
>can be used on all compilers. That situation is only improving.
Me too, but I don't use anything new (even "old" ANSI/ISO Draft C++)
in them.That's not what I expected 5 years ago.

>d) Lots of people use the streams in real programs.
I'm happy to know that. But under Windows, for example,
it's hard to prefer them over MFC's CFile...

>Relax a little.
Always. Thank you.

Michel Michaud micm19@mail2.cstjean.qc.ca



[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: "Michel Michaud" <Michel.Michaud@sympatico.ca>
Date: 1998/07/09
Raw View
I always thought that ios::app (now ios_base::app)
"should" mean ios_base::out|ios_base::app, but it
was not the case when using a fstream. My reading
of the draft standard is that

     an_fstream.open("file", ios_base::app)

should simply fail, so you need to add ios_base::out.

But in their new book, Lippman and Lajoie give an
example --with a comment !-- (pg.1102) :

    // ios_base::out would discard current data
    file.open("word.out", ios_base::app);

Has anything changed since the draft ?

In Stroustrup, we can read pg.639 that the
actual values and their meaning are
implementation-defined... and we should do
experiments!

What kind of a standard is that!

I don't understand that such basic items are
not better understood or understandable. As I
see it, C++ could fail because of the
standardisation... With such a big library
it will take decades before we can write
serious programs that can be used on all
compiler. Or is it that nobody really use
the streams in real program ?

Michel Michaud, micm19@mail2.cstjean.qc.ca



[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]