File write may NOT truncate the rest of file?
Posted
#1
(In Topic #1278)
Regular

If I do a write with an smaller content, the file is keeping the extra "piece".
If I delete (kill) and create, goes right.
Is there a trick to writing correctly (and truncating the rest if necessary) ?
Example I have a file with 1000 bytes, and I write 995, the file doesn't get truncated, keeps 1000 bytes (5 trash bytes)
Thanks
Posted
Regular

Posted
Guru

Posted
Regular

In them, WRITE operation usually included "truncating", meaning almost an "overwrite".
CREATE seems to be to use only if the file didn't exist. Now I understand.
Thanks for all
1 guest and 0 members have just viewed this.


