binary file + fread
| From: | Michael Agbaglo | Date: | Sun, 27 Jan 2002 16:09:16 +0000 |
| Subject: | binary file + fread | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82292@lists.php.net to get a copy of this message | ||
Hi !
I've some trouble w/ the following peace of code... Althoug the file doesn't contain zeros at the beginning the output is
a= 0 b=0
Is there a problem w/ fread ? (php 4.0.6, RedHat 7.2)
<?php
$filename = "/export/html/log";
$fd = fopen( $filename, "r" );
$a = fread( $fd, 4 );
$b = fread( $fd, 4 );
printf( "a= %lx b=%lx", $a, $b);
fclose( $fd );
?>