ID: 13667
Updated by: sander
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Filesystem function related
Operating System: Windows 2000 Advanced Server
PHP Version: 4.0.6
New Comment:

>From the docs:
"... place the file pointer at the beginning of the file and truncate the file to zero 
length"
I don't think there is much to read from a zero-length file...

Previous Comments:
------------------------------------------------------------------------

[2001-10-14 17:45:41] [EMAIL PROTECTED]

$fh = fopen('myfile.txt', 'w+');
$content = fread( $h, filesize('myfile.txt'));
echo $content;
fseek( $fh, 0 );
fwrite( $fh, $newcontent );
ftruncate( $fh, strlen( $newcontent ) );

No matters de contents of myfile.txt, no output is generated. 
If I replace the first line to 
$fh = fopen('myfile.txt', 'r+');
everythings works fine if the file exists.

Manu.

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=13667&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to