If a file is 10 bytes long and you seek to the beginning and write 8 bytes, the file will remain to be 10 bytes long -- you will only modify the first 8 bytes, leaving the last two unchanged. If you want to discard the remaining bytes, you need to truncate the file.





Reply With Quote

Bookmarks