#35886 [Asn]: file_get_contents() fails with some combinations of offset & maxlen
| From: | nlopess@php.net | Date: | Mon, 05 Jun 2006 12:00:26 +0000 |
| Subject: | #35886 [Asn]: file_get_contents() fails with some combinations of offset & maxlen | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98036@lists.php.net to get a copy of this message | ||
ID: 35886
Updated by: nlopess@php.net
Reported By: chris at lodesys dot com
Status: Assigned
Bug Type: Streams related
Operating System: win32 only
PHP Version: 5CVS-2006-01-03 (snap)
Assigned To: wez
New Comment:
here is the patch:
http://mega.ist.utl.pt/~ncpl/php_win_mmap_segfault.txt
Previous Comments:
------------------------------------------------------------------------
[2006-03-02 22:50:13] piecia2000 at tlen dot pl
Temporary solution (slighty slower):
$fd = fopen($filename, "rb");
fseek($fd, $offset);
$file = fread($fd, $size);
fclose($fd);
please fix file_get_contents(),
------------------------------------------------------------------------
[2006-02-23 07:21:30] ninive at gmx dot at
Please fix this critical bug.
------------------------------------------------------------------------
[2006-02-08 02:23:46] chris at lodesys dot com
The example test file is C:/php/news.txt (part of the PHP Windows
distribution). It is 74 KB (75,800 bytes). Was having problems with
files larger than that (say up to 170 KB). Didn't test with extra
large files.
------------------------------------------------------------------------
[2006-02-08 00:50:26] iliaa@php.net
How big is the file?
------------------------------------------------------------------------
[2006-01-05 02:21:26] nlopess@php.net
OK, the problem is in the MapViewOfFile() call in
php_stdiop_set_option(), because it is mapping less data than we've
asked.
It seems a windows problem to me, but I'm leaving open because this can
be a serious bug (although I'm not able to fix it..).
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35886
--
Edit this bug report at http://bugs.php.net/?id=35886&edit=1