Hello! Help is needed! I am writing a program that throughout the disk (Windows), must find files with the ini extension. Oddly enough, I write code in PHP, this is important .. Here is the code:
class ReadableFilter extends RecursiveFilterIterator{ public function accept(){ return $this->current()->isReadable(); } } function Search($dir, $ext){ $iterator = new ReadableFilter(new RecursiveDirectoryIterator($dir)); $iterator = new RecursiveIteratorIterator( $iterator ); $filter = new RegexIterator($iterator, '/^.+\.(?:'.$ext.')$/i', RecursiveRegexIterator::GET_MATCH); $filelist = array(); foreach($filter as $entry) { $filelist[] = $entry[0]; } return $filelist; } Well, now, it’s necessary to do something to make the code work quickly, otherwise it’s not reasonable to wait 10-15 or even 30 minutes, I don’t know, they can do some sort of restriction on the file size, or something else .. And who else understands this class, how can you restrict certain folders so that it does not search! Thank you in advance!