#22497 [Opn]: php writes on wrong position in file after new lines

From: Date: Sat, 01 Mar 2003 22:20:57 +0000
Subject: #22497 [Opn]: php writes on wrong position in file after new lines
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-34597@lists.php.net to get a copy of this message
ID: 22497 User updated by: henrik dot gebauer at web dot de -Summary: Problem with method call Reported By: henrik dot gebauer at web dot de Status: Open Bug Type: Filesystem function related Operating System: Windows 2000 PHP Version: 4CVS-2003-03-01 (stable) New Comment: sorry, Netscape filled the summary with the wrong contents. Previous Comments: ------------------------------------------------------------------------ [2003-03-01 16:07:52] henrik dot gebauer at web dot de Note: The new line chars can be everywhere in the first string. ------------------------------------------------------------------------ [2003-03-01 16:06:20] henrik dot gebauer at web dot de New line chars seem not to count any longer. The following example writes 6 new lines in a file, then 20 chars. 'test' should be placed after the last '9' but it is placed after the last '3' (6 characters earlier as there are 6 new line chars) I didn't have the problem with earlier versions of PHP. <?php $fp = fopen('file.txt', 'w'); fwrite($fp,"\n\n\n\n\n\n01234567890123456789"); fwrite($fp, 'test'); fclose($fp); readfile('file.txt'); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22497&edit=1

« previous php.bugs (#34597) next »