isftstream::is_open()

is_open() seems to always return ‘open’, even just after the istream has
been created and before the file has actually been opened, or after it has
been opended and then closed. What’s going on? How can I check if a file is
open? (Note: not just that the open() call succeeded or failed).
(Btw, this code works as expected under MSVC++.)

“Frank Kolnick” <fkolnick@sentex.net> wrote in message
news:8vb6g2$7fg$1@inn.qnx.com

is_open() seems to always return ‘open’, even just after the istream has
been created and before the file has actually been opened, or after it has
been opended and then closed. What’s going on? How can I check if a file
is
open? (Note: not just that the open() call succeeded or failed).
(Btw, this code works as expected under MSVC++.)

Geez, can’t type this morning – should be “ifstream::is_open()” :slight_smile: