Used c_str() in open for ubuntu.