打开 QFile 进行追加
如何打开一个 QFile 进行追加,即相当于
How can I open a QFile for appending, i.e. the equivalent of
FILE *f = fopen("myfile.txt", "a");
推荐答案
以QIODevice::Append
模式打开文件:
QFile f(...);
if (f.open(QIODevice::WriteOnly | QIODevice::Append)) {
...
}
另请参阅文档.
相关文章