|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-03-21 17:05 UTC] mfischer@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 20 21:00:02 2025 UTC |
Under the latest CVS, the following script fails (ftruncate() returns an error and doesn't truncate the file) but under PHP 4.1.2, it works fine: <?php if (! $fp = fopen('test','r+')) { die("Can't open test"); } if (! ftruncate($fp,0)) { die("Can't truncate"); } fclose($fp); ?> (The file "test" exists and has some text in it.) I get the same results whether the mode passed to fopen() is "r", "r+", "a", or "a+" (with "w" or "w+", the call to ftruncate() still fails, but the file is truncated due to the nature of the "w" fopen mode).