home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: g++ ofstream
- Message-ID: <1992Nov20.185012.26503@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Nov19.173058.14847@cc.gatech.edu>
- Date: Fri, 20 Nov 1992 18:50:12 GMT
- Lines: 21
-
- brianm@cc.gatech.edu (Brian N. Miller) writes:
-
- >What flags should i check or what method shall i call
- >to determine if a once opened g++ ofstream has since been closed?
-
- I don't know how standard the g++ implementation of iostreams is.
- In the usual implementation, you want the is_open() function in the
- filebuf. You can call it like this:
-
- ofstream mystr( ... );
- ...
- if( mystr.rdbuf()->is_open() ) {
- ... a file is open
- }
- else {
- ... no file is open
- }
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
- Vice Chair, ANSI C++ Committee, X3J16
-