Topic: basic_filebuf question (redux)
Author: bkline@cortex.nlm.nih.gov (Bob Kline Phoenix Contract)
Date: 1995/06/13 Raw View
This is a re-posting of a question I submitted some time back, to
which I never got any responses, and which appears to have disappeared.
(I was tempted to pepper the subject line of this article with eye-catching,
off-topic words, including the surname of a controversial poster, having
observed that articles with such subjects have a significantly higher
chance of getting a response than those dealing with the C++ draft
standard, but I refrained :->}).
Here it is again:
Section 27.8.1.3 (describing the member functions of template class
basic_filebuf) says:
----------------------------------------------------------------------
"bool is_open() const;
Returns: true if the associated file is available and open.
basic_filebuf<charT,traints>*
open(const char* s, ios_base::openmode mode);
Effects: If is_open() == false, returns a null pointer. Otherwise,
calls basic_streambuf<charT,traits>::basic_streambuf() (27.5.2.1).
It then opens a file, if possible, whose name is the NTBS s ("as
if" by calling ::fopen(s, modstr))."
----------------------------------------------------------------------
If open() "opens [the] file" only after determining that is_open()
is *not* false, what is meant by the phrase "is available and open"
in the description of is_open()? This doesn't make sense to me.
--
/*----------------------------------------------------------------------*/
/* Bob Kline Stream International */
/* bob_kline@stream.com formerly Corporate Software, Inc. */
/* voice: (703) 522-0820 x-311 fax: (703) 522-5407 */
/*----------------------------------------------------------------------*/