|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-06-02 08:23 UTC] mike@php.net
-Status: Open
+Status: Not a bug
[2014-06-02 08:23 UTC] mike@php.net
[2014-06-02 08:58 UTC] roman4e at gmail dot com
[2014-06-02 09:11 UTC] mike@php.net
[2014-06-02 10:36 UTC] roman4e at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 02:00:01 2025 UTC |
Description: ------------ php v.5.5.5 (cli) (built: Mar 17 2014 12:31:03) (DEBUG) fseek() does not return error (-1) on read out of file, returns 0 Test script: --------------- $f = fopen("file","r"); // file must be several KBytes size $page = 0; while ( !fseek($f,$page,SEEK_SET) ) { $page += 1024; $str = fread($f,1024); if ( $str === false ) die("error reading block"); } echo "ok" Expected result: ---------------- fseek should return -1; Actual result: -------------- file size of 76800 result of reading out of file. last parametr is type of data returned by fread Pageoff = 75776 fseek=0 ftell=75776 read=1024 string Pageoff = 76800 fseek=0 ftell=76800 read=0 string Pageoff = 77824 fseek=0 ftell=77824 read=0 string