Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

[Solved] Appending to the end of a text file

$
0
0
In the following code snippet, there’s a QString called parameterString that contains a few lines of information, and I’m trying to append it to the end of a text file. I was using QFile::Append before, but it kept adding a phantom carriage return/line feed in between the previous end of file and the new data.     QString parameterFileString("../sdcard/ParameterLog_1.csv");     QFile parameterFile(parameterFileString);     if(parameterFile.open(QFile::WriteOnly | QFile::Text))     {         parameterFile.seek(parameterFile.size());         QTextStream out(&parameterFile);         out << parameterString;         parameterFile.close();     } This gives me weird results. Some of the data from the original file is there but not all. What am I doing wrong?

Viewing all articles
Browse latest Browse all 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>