change ostream open arguments to c_str