Edit
by Gerry Danen - 9 years ago (2015-10-07)
I need to find large files on a server
| Is there a class that will traverse an entire server and list all files over a certain (5MB, for example) size?
|
Ask clarification
3 Recommendations
This class can manipulate and search files and directories.
It can create directories, read and write, as well and delete files and folders recursively using PHP iterator classes.
The class can also search for files inside given directories recursively using regular expressions to filter the file names.
| by Joshua McKenzie package author 75 - 9 years ago (2015-12-07) Comment
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. |
PHP SPL File Find: SPL iterator to find files with different criteria
This package implements SPL iterators to find files with different criteria.
It can take a path a directory to traverse to start finding files.
There are additional iterator classes to sort files by name, sort by type, sort by last access time, sort by last change time, to filter files with a given file name extension, filter only files or only directories, and to limit the number of found files, or limit by directory depth or file size.
| by Ravi Kumar package author 100 - 9 years ago (2015-10-18) Comment
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 $files = $find->size('>50m')->in( $path ); |
File Display: Displays listings of files and directories
This class is meant to output listings of files and sub-directories of a given directory using HTML tables.
It can be configured to display or not display several types of information such as: file size, file/folder permissions, last modified date, etc..
It may restrict the listing of files based on the file name extension. Currently, the default is to allow showing only image files: GIF, JPEG and PNG.
It may also show different icons with files depending on their file name extension.
| by Dave Smith 7620 - 9 years ago (2015-10-09) Comment
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 Comment
1.
by Gerry Danen - 9 years ago (2015-10-09) Reply
Thanks, Dave. I believe that will indeed do the trick.