php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6075 fread OR fwrite bug
Submitted: 2000-08-10 15:29 UTC Modified: 2000-08-19 12:14 UTC
From: kijung at orangebank dot co dot kr Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.0 OS: linux
Private report: No CVE-ID: None
 [2000-08-10 15:29 UTC] kijung at orangebank dot co dot kr
/* 
    Greetings!!!

    file size before implementing test14.php 
    newmail.gif(915)
    -> file size after implementing test14.php
    newmail_out.gif(946)

    It operates correctly in php version 3.0.
    But, It oprerates incorrectly in php versin 4.0.
    
    and, if file type is *.txt, this program is operates 
    correctly
    
    I thinks that fread() or fwrite() is problem.    

    please, tell me solution of this problem.
    I don't know that i don't know.
*/
<?

$filename1 = "newmail.gif";
$filename2 = "newmail_out.gif";

$fd1 = fopen($filename1,"rb");
$fd2 = fopen($filename2,"wb");

$data = fread($fd1, filesize($filename1));

fwrite($fd2, $data);

fclose($fd1);
fclose($fd2);

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-10 15:37 UTC] stas@php.net
Should be fixed in latest CVS. If not, please reopen.
 [2000-08-10 16:45 UTC] stas@php.net
So, does it happen in the latest version?
 [2000-08-19 12:14 UTC] joey@php.net
I could duplicate this bug with 4.0.0, but no longer see it in CVS,
so closing. If you still see this behavior, please open a new report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 03:01:32 2024 UTC