<html>
<head><title>shagaTail class description</title></head>
<body>
<p>This is a simple class for reading files from the end,like Unix 'tail' command.But
with some limitations!You can get only the last line<br />
There are many implementations like this,but this use less memory,than others,i
hope... </p>
<p><font size="2" color="#990033">How you can use it?</font> </p>
<p>An example:<br />
<br />
</p>
<pre><font color="#0066FF"><?
//
// tail-usage.php
//
//
require_once("shagaTail.php");
$myShaga = new shagaTail;
$myShaga->tailFile = 'filename.log'; //setting the filename
for(;;){
$line = $myShaga->getStr();
// Analize the line or just print it
echo $line."<br />\n";
$myShaga->update(); // if the tailed file file is updated,tail it again
}
</font></pre>
<font color="#0066FF"> ?> </font>
</body>
</html> |