php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12536 fread does not look to be working right
Submitted: 2001-08-02 17:34 UTC Modified: 2001-08-06 01:05 UTC
From: knightemu at yahoo dot com Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 4.0.4pl1 OS: win 98 box
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: knightemu at yahoo dot com
New email:
PHP Version: OS:

 

 [2001-08-02 17:34 UTC] knightemu at yahoo dot com
fread does not look like it is reading the EOF. when i use a large (HUDGE) number to tell the fread() how many characters to read, it takes a  l o n g time for this to complete!!!! this happens even when the file is very short.

i descoverd this when i was trying to read an entire file into a string. is fread the best way to do this?? it does not seem to be working very well.

there is also a error reporting problem with fread. after the same number gets too big, php stops processing the entire page, (it does check syntax)
there is als no error message when this happens.....

            Knight

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-02 17:38 UTC] sniper@php.net
Have you tried with PHP 4.0.6? And could you also 
add a short example script into this bug report?

--Jani

 [2001-08-05 22:25 UTC] knightemu at yahoo dot com
$filefill = fread($fp, 100000000); //will take a long time on a very small file.

if you add another 0, it will cause a "Internal Server Error" - this is not surprising. computers dont deal well with BIG numbers.

i could not get php to re-create the error where it silently did not work.
 [2001-08-06 01:05 UTC] sniper@php.net
You should consider using something like the first
example is on this page:

http://www.php.net/manual/en/function.fread.php

Anyway, works very nicely for me with PHP 4.0.6 in WindowsME.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC