note 72421 added to migration5.incompatible

From: Date: Thu, 18 Jan 2007 09:51:47 +0000
Subject: note 72421 added to migration5.incompatible
Groups: php.notes 
Request: Send a blank email to php-notes+get-121875@lists.php.net to get a copy of this message
fopen uses stat cache in PHP5. It could cause problems if you open files in append mode, as the file pointer will point on last known end of file, and does not check if the file is bigger. Example : // first call creates the file an set position to zero $f = fopen("filename.txt", "a"); fputs($f, "Hello World\n"); fclose($f); // PHP4 : second call opens the file and points on end // PHP5 : second call opens the file and points on zero ! // you should do a clearstatcache(); here $f = fopen("filename.txt", "a"); fputs($f, "Second Hello World over\n"); fclose($f); // result in PHP5 : the file only contains "Hello World over" ---- Server IP: 217.174.196.197 Probable Submitter: 193.252.107.244 ---- Manual Page -- http://www.php.net/manual/en/migration5.incompatible.php Edit -- https://master.php.net/note/edit/72421 Del: integrated -- https://master.php.net/note/delete/72421/integrated Del: useless -- https://master.php.net/note/delete/72421/useless Del: bad code -- https://master.php.net/note/delete/72421/bad+code Del: spam -- https://master.php.net/note/delete/72421/spam Del: non-english -- https://master.php.net/note/delete/72421/non-english Del: in docs -- https://master.php.net/note/delete/72421/in+docs Del: other reasons-- https://master.php.net/note/delete/72421 Reject -- https://master.php.net/note/reject/72421 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#121875) next »