Read log file with SplFileObject Class and flag SKIP_EMPTY not work

381 views Asked by At

I need to read some rsync log files, and these have some empty lines

I try to use:

$f = new \SplFileObject($file);

$f->setFlags(7); // Test 6 value and same problem

   while (!$f->eof())
   {
     // Do something
     // But $f->fgets() show any empty "" line

   }

According with manual

/* Constantes */
const integer DROP_NEW_LINE = 1 ;
const integer READ_AHEAD = 2 ;
const integer SKIP_EMPTY = 4 ;
const integer READ_CSV = 8 ;

What it's wrong on my code?

0

There are 0 answers