According to the answers from this question calling truncate
does not actually move the position of a file.
So my question is, if I truncate
a file to length zero after I read something from it (because I want to write from the beginning) should I / do I have to also call seek(0)
to make sure I am at the beginning of the file?
This seems a little redundant because the file of length zero would have to be at the beginning right?