open() takes const char * and not std::string. Fix that.