我只想向日志文件写入(追加)内容。我在这里查找了信息:
http://www.cplusplus.com/reference/iostream/fstream/open/
然后我这样做了:
#include <fstream>
fstream outfile;
//outfile.open("/tmp/debug.txt" ); // works, simply for writing
outfile.open("/tmp/debug.txt", fstream::app ); // does nothing
outfile << "START" << endl;
outfile.close();