THIS LOOP GOES ON FOREVER!!!
[php]$sec = 0;
while ( $sec <= 10 )
{
if ( inotify_queue_len($inotify) > 0 )
{
$i = fopen($in, ‘r+’);
fwrite($shell, fread($i, filesize($in)));
ftruncate($i, 0);
fclose($i);
while ( inotify_read($inotify) ) {}
//$sec += 1;
}
fwrite($o, fread($shell, 4096));
sleep(1);
$sec += 5;
}[/php]
but this one doesn’t
[php]$sec = 0;
while ( $sec <= 10 )
{
if ( inotify_queue_len($inotify) > 0 )
{
$i = fopen($in, ‘r+’);
fwrite($shell, fread($i, filesize($in)));
ftruncate($i, 0);
fclose($i);
while ( inotify_read($inotify) ) {}
//$sec += 1;
}
fwrite($o, fread($shell, 4096));
sleep(1);
$sec = 15;
}[/php]
I don’t get it??? I’m probably making a really stupid mistake please point it out.