Bug #13625 Updated: fwrite writes more data to file than in output string
| From: | derick@php.net | Date: | Wed, 10 Oct 2001 10:54:57 +0000 |
| Subject: | Bug #13625 Updated: fwrite writes more data to file than in output string | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67674@lists.php.net to get a copy of this message | ||
ID: 13625
Updated by: derick
Reported By: jayp@clear.net.nz
Old Status: Duplicate
Status: Bogus
Bug Type: Output Control
Operating System: W2K
PHP Version: 4.0.6
New Comment:
Bogus but it was added twice.
Previous Comments:
------------------------------------------------------------------------
[2001-10-10 05:46:53] jayp@clear.net.nz
I gave a SQL DB with GIF data field. f.ex there are 2*27006 bytes in there (hex strings). I can
retrieve them without any problems but when I do
$fp = fopen($fn, 'wb');
$Bin = ConvertToBinary($GIFString);
$BlockLength=strlen($Bin);
set_file_buffer($fp, 0);
fwrite($fp,$Bin);
fclose($fp);
$GIFString has the correct size of 2*27006,
$Bin has the correct binary size of 27006.
But the file has the size of 27176 bytes. I have no idea where the addiotnal 170 bytes are coming
from (doesn't help when add the $BlockLength to fwrite). After 0x363 there is a 1 byte shift
etc...
regards
Jay
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13625&edit=1