Use raw_fd_ostream instead of std::ofstream.