title: c++ clear the contents of a file after a specific position
body: <p>I would like to use either <code>fstream</code> or preferably <code>QFile</code> to remove the contents of a file <strong>after</strong> a specific position (that's not the beginning or the end of the file). So I first jump to that position with <code>QFile::seek(long)</code> or equivalent in <a href="https://stackoverflow.com/questions/6171403/qfile-seek-performance/6171433">constant time</a>, and then I would like to remove the remainder of the content, also in constant time. What approach do you recommend?</p>