|All requests||>||Find Large Files||>||Request new recommendation||>||Featured requests||>||No recommendations|
by Gerry Danen - 5 years ago (2015-10-07)
Is there a class that will traverse an entire server and list all files over a certain (5MB, for example) size?
To give another variety, PHP5 Iterators, Regex supported, Composer ready To find files above a certain size, when looping the search results, simply use the $file->getSize() method provided with the DirectoryIterator class.
The in() method lists all the files in a given directory, and returns an array of the names. You can filter out which files you want with a size() method. see example
$find = new Find;
Filter files by size
Looks like this one will do it with a little modification. It currently has a method that filters out any file that is not an image which can be changed and it does list file size which should be able to be used as the filter instead.
1. by Gerry Danen - 5 years ago (2015-10-09) Reply
Thanks, Dave. I believe that will indeed do the trick.