Я разносил базу Пастухова - какое-то огромное количество гигов.
Принцип работы, надеюсь, будет понятен:
set_time_limit(0);
$file = 'E:\\temp\SortedHugeKeywords.txt';
$c_words = 100000;
$str = $_GET['str'];
if($_GET['str'] == "Start!!!")$str = "";
$i = intval($_GET['i']);
$words = 0;
$go = TRUE;
$fh = fopen($file, "r");
while($go and $words<$c_words)
{
if(feof($fh))
{
$go = FALSE;
}
else
{
fseek($fh,$i);
$str .= fread($fh, 1);
$i++;
if(stristr($str,"\n"))
{
}
}
}
fclose($fh);
$this->result = '<table border="1" align="center">
<form action="index.php">
<input type="hidden" name="act" value="module">
<input type="hidden" name="module" value="file">
<tr>
<td>Кусок строки:<input type="text" name="str" value="'.$str.'"></td>
</tr>
<tr>
<td>Позиция:<input type="text" name="i" value="'.$i.'"></td>
</tr>
<tr>
<td><input type="submit" name="go" value="!!!"></td>
</tr>
</form></table>';
if($go)$this->result .= "<meta http-equiv=\"Refresh\" Content=\"10; URL=index.php?act=module&module=file&str=%20&i=".$i."\">";
_____________
Бесплатному сыру в дырки не заглядывают...