[phpug] Re: fread() file size limit?

2009-01-02 Thread Michael
On Fri, 02 Jan 2009 11:01:20 Matthew White wrote: How are you using fread? Something like $contents = fread($handle, filesize($filename)); Yes, like that. Will read the whole thing into memory, which is not something you really want to do as previously noted Well, the system does have

[phpug] Re: fread() file size limit?

2009-01-01 Thread Tony Rigden
Are you trying to load the entire file into memory? fread will read only a maximum of 8192 bytes at a time. See http://nz2.php.net/fread. It is not desirable to the memory limit that high nor should it be needed. Most people have it set to a max of about 32 Mb if they are using graphics or less

[phpug] Re: fread() file size limit?

2009-01-01 Thread Michael
On Fri, 02 Jan 2009 07:28:45 Tony Rigden wrote: Are you trying to load the entire file into memory? fread will read only a maximum of 8192 bytes at a time. See http://nz2.php.net/fread. It is not desirable to the memory limit that high nor should it be needed. Most people have it set to a max

[phpug] Re: fread() file size limit?

2009-01-01 Thread Matthew White
How are you using fread? Something like $contents = fread($handle, filesize($filename)); Will read the whole thing into memory, which is not something you really want to do as previously noted Can you tell us a little more about the nature of the file? If its textual rows, with the \n