list_files [ WordPress Function ]
list_files ( $folder = '', $levels = 100 )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.
The depth of the recursiveness can be controlled by the $levels param.
Source
<?php
function list_files( $folder = '', $levels = 100 ) {
if ( empty($folder) )
return false;
if ( ! $levels )
return false;
$files = array();
if ( $dir = @opendir( $folder ) ) {
while (($file = readdir( $dir ) ) !== false ) {
if ( in_array($file, array('.', '..') ) )
continue;
if ( is_dir( $folder . '/' . $file ) ) {
$files2 = list_files( $folder . '/' . $file, $levels - 1);
if ( $files2 )
$files = array_merge($files, $files2 );
else
$files[] = $folder . '/' . $file . '/';
} else {
$files[] = $folder . '/' . $file;
}
}
}
@closedir( $dir );
return $files;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- list_files
list_files. Lists all of the variables that reference files. ... f = addfile("hgt.mon.mean. nc","r") g = addfile("slp.mon.mean.nc" ,"r") h = addfile("soi.nc" ,"r") list_files() ...
www.ncl.ucar.edu - File (Java 2 Platform SE v1.4.2)
listFiles. public File[] listFiles(). Returns an array of abstract pathnames ... The behavior of this method is the same as that of the listFiles() method, except that the ...
download.oracle.com - How to list files on a directory from Oracle Database. « David Marcos ...
Sep 13, 2011 ... CREATE OR REPLACE FUNCTION LIST_FILES (lp_string IN VARCHAR2 default null) RETURN file_array pipelined AS lv_pattern ...
davidalejomarcos.wordpress.com - kohana::list_files v. php scandir - Kohana Forums
I tried using kohana::list_files but I keep getting an empty array returned, making me think I don't know the proper path. However for scandir() ...
forum.kohanaframework.org