basic_fstream::open

void open(const char *s,
    ios_base::openmode mode = ios_base::in | ios_base::out);

The member function calls rdbuf()-> open(s, mode). If that function returns a null pointer, the function calls setstate(failbit).