Now that I have the other problem fixed I want to revisit the issue of large 
file handling -

This is the code (placed within an array loop) -
----------------------------------
// Determine MIME type:
$mt=MIME_Type::autoDetect("$filename");

// If suitable MIME type open, read and process:
if (substr($mt,0,4) == "text") {

// read the file:
$content = file_get_contents($filename,FILE_TEXT);

// extract the information:
preg_match_all($pattern,$content,$matches);

// add it to our array:
foreach($matches[0] as $m) $results[] = $m;

// unset the temporary array:
unset($matches);

// count valid file(s) scanned:
$pv = $pv + 1;

}; // end the MIME type statement
------------------------------------
What is happening is that when I try and read a 1.9Gb text file, it fails, 
with the following error message:
Scanning files:
Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to 
allocate 2023554020 bytes) in /www/scan.php on line 124

Now the fix is probably pretty straight forward - does anyone have any idea 
please?

Thanks in anticipation,

Michael

--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to nzphpug@googlegroups.com
To unsubscribe, send email to
nzphpug+unsubscr...@googlegroups.com
-~----------~----~----~----~------~----~------~--~---

Reply via email to