Topic: What does "available and open" mean?
Author: bkline%occs.nlm.nih.gov (Bob Kline Phoenix Contract)
Date: 1995/05/26 Raw View
Either my poor brain has turned to porridge trying to plow through
the material in the draft or the same fate has befallen the authors
of the I/O library section of the document (or perhaps both :->}).
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()? "On the disk and 'open' for
business"? This is really slicing the poor English language a
little too thin, if you ask me. Would the author of this version
of the section please tell me what it's supposed to mean? I
understood the language it replaced, but this looks like spaghetti
to me.
--
/*----------------------------------------------------------------------*/
/* Bob Kline Stream International */
/* bob_kline@stream.com formerly Corporate Software, Inc. */
/* voice: (703) 522-0820 x-311 fax: (703) 522-5407 */
/*----------------------------------------------------------------------*/