ID: 28618 Comment by: ericfabre69 at free dot fr Reported By: lapo at lapo dot it Status: Open Bug Type: Filesystem function related Operating System: Win2000 PHP Version: 5.0.0RC2 New Comment:
Hi, I have the same problem with the 4.3.8 php version. When I use this script set_time_limit(0); $fp = fopen ($path,"r"); $contents = fread($fp,5000000); echo $contents; $fp2 =fopen("temp.txt","w+"); fwrite($fp2,$contents); fclose($fp); fclose($fp2); echo "<br>size : ".filesize("temp.txt"); I try to open a file (size 26ko) All the time the filesize("temp.txt") result is 4092. I hadn't this problem with the version 4.2.x. Previous Comments: ------------------------------------------------------------------------ [2004-06-03 11:05:50] lapo at lapo dot it Description: ------------ I used to use a little script (see below) to check logs from remote and it worked like a charm with PHP4.3.2 both on FreeBSD and Win2000 (CGI on IIS). Upgrading to PHP5.0.0RC2, on Win2000, it gives timeout when file size is 'big' (e.g. it does definitely do so with a 5Mb log file). Of course it should print only the last 5Kb of file, no matter the filesize. BTW: using @fread($file, 1024 * $n) instead of @fpassthru($file) works perfectly and I'm doing so, but @fpassthru($file) SHOULD be more efficient and I wuold like it to work, anyway. Reproduce code: --------------- $log_file = ini_get('error_log'); $n = 5; $file = @fopen($log_file, 'r'); @fseek($file, -1024 * $n, SEEK_END); @fpassthru($file); Expected result: ---------------- Last 5Kb of log file content. Actual result: -------------- CGI timeout. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28618&edit=1