Re: DirectoryIterator

From: Date: Tue, 26 Jan 2010 21:06:48 +0000
Subject: Re: DirectoryIterator
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-301494@lists.php.net to get a copy of this message
On Tue, Jan 26, 2010 at 2:05 PM, Christoph Boget <cboget@hotmail.com> wrote: > I executed the following test script several times. Each time, in a > separate terminal window, I ran "touch bob.txt" after the script started > echoing out. After the script completed, I deleted bob.txt. During each > execution, not once did bob.txt show up in the output. This makes me > believe that the file collection that DirectoryIterator is going to work > with is set at instantiation. If that's the case, it makes little sense to > me that you are unable to get the size of that collection from the > DirectoryInterator object. > > <?php > $dirList = new DirectoryIterator(MY_DIR); > foreach($dirList as $file ) > { > echo $file->getFilename() . '<br>'; > flush(); > sleep( 1 ); > } > ?> > in that case you would likely need to expose something extra from the C layer. -nathan

« previous php.general (#301494) next »