#30441 [NoF->Csd]: file_get_contents and fread don't read the wholle file
| From: | sniper@php.net | Date: | Mon, 23 May 2005 12:59:43 +0000 |
| Subject: | #30441 [NoF->Csd]: file_get_contents and fread don't read the wholle file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-79385@lists.php.net to get a copy of this message | ||
ID: 30441
Updated by: sniper@php.net
Reported By: christian at koch dot net
-Status: No Feedback
+Status: Closed
Bug Type: Filesystem function related
Operating System: Windows XP SP2
PHP Version: 5.0.2
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-10-22 13:54:53] tony2001@php.net
I can't reproduce it with PHP 5.1.0-dev, 5.0.3-dev and 4.3.10-dev.
Please, provide a downloadable example.
------------------------------------------------------------------------
[2004-10-22 13:46:37] christian at koch dot net
bug is still in 5.01 and 5.00
------------------------------------------------------------------------
[2004-10-22 13:41:45] christian at koch dot net
read a file into a string, the string has a different content as the
file. try this
<?php
var_dump(file_get_contents("testfile.txt"));
?>
where textfile.txt contains:
begin
<blafasel begin="<%testtag name="abc"%>" soso stop>
bla="fasel" begin="<%testtag name="abc"%>" soso stop
blafasel begin="<%testtag name="abc"%>" soso stop
blafasel begin="<%testtag name="abc"%>" soso stop
blafasel begin="<%testtag name="abc"%>" soso stop
blafasel begin="<%testtag name="abc"%>" soso stop
<meta name="ef-type" content="template">
<meta name="lower-file" content="<%ATTRIBUTE
name="lower-file"%>">
<meta name="keywords" content="<%ATTRIBUTE
name="keywords"%>,<%COMPONENT
file="/templates/hallo.html"%>">
<meta name="edate" content="<%ATTRIBUTE name="edate"%>">
blafasel begin="<%testtag name="abc"%>" soso stop
blafasel begin="<%testtag name="abc"%>" soso stop
end
the differences occurs at line 2(chr 37) and line 10(chr 62). both are
" (doublequotes) the error occurs too if I use the fread() function.
Hope this is enough info
I've made an upgrade to 5.02. the still occurs
Christian
------------------------------------------------------------------------
[2004-10-21 23:22:01] wez@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2004-10-15 08:35:15] christian at koch dot net
Description:
------------
<part of the file where problem occurs>
<meta name="ef-type" content="template">
<meta name="lower-file" content="<%ATTRIBUTE
name="lower-file"%>">
<meta name="keywords" content="<%ATTRIBUTE
name="keywords"%>,<%COMPONENT file="/templates/hallo.html"%>">
<meta name="edate" content="<%ATTRIBUTE name="edate"%>">
</part>
<result after file_get_contents()>
<meta name="ef-type" content="template">
<meta name="lower-file" content="<%ATTRIBUTE
name="lower-file%>">
<meta name="keywords" content="<%ATTRIBUTE
name="keywords%>,<%COMPONENT
file="/templates/hallo.html"%>">
<meta name="edate" content="<%ATTRIBUTE name="edate%>">
</result>
I'm missings some (") if there are outer (") then the second inner (")
is missing.
Christian
Reproduce code:
---------------
var_dump ( file_get_contents("<anyfilename>") );
Expected result:
----------------
if i read a file i think the file shoud be read completely :-)
Actual result:
--------------
s.o.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30441&edit=1