note 13409 deleted from function.ftruncate by bjori
| From: | bjori@php.net | Date: | Thu, 16 Nov 2006 16:19:20 +0000 |
| Subject: | note 13409 deleted from function.ftruncate by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-119809@lists.php.net to get a copy of this message | ||
Note Submitter: jim dot hatfield at insignia dot com
----
ftruncate does not alter the position of the file pointer. If you edit a file in-place by opening
for reading and writing, reading the file, truncating and writing out again, you have to seek to the
beginning before writing or you get as many NULLs as there were bytes in the original file, then
your new content.