Use truncation on file create to avoid leaving trailing garbage

r? @metajack