basic_filebuf::is_open

bool is_open();

The member function returns true if the file pointer is not a null pointer.