file : add scandirNotSorted function
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2984 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
17
file.php
17
file.php
@@ -405,6 +405,23 @@ class file
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Return the list of files and directories in the directory.
|
||||||
|
* Do not return the . and .. virtual dirs.
|
||||||
|
* The result is NOT sorted
|
||||||
|
* @param string $directory The directory to read
|
||||||
|
* @return array the list of files and dirs
|
||||||
|
* @throws If directory not exists, or is not executable
|
||||||
|
*/
|
||||||
|
public function scandirNotSorted ($directory)
|
||||||
|
{
|
||||||
|
$this->debug (2, "scandirNotSorted ($directory)");
|
||||||
|
$directory = $this->realpath ($directory);
|
||||||
|
$this->checkPathRO ($directory);
|
||||||
|
$res = array_values (array_diff (scandir ($directory, SCANDIR_SORT_NONE),
|
||||||
|
array('..', '.')));
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
/** Create a new file or update the timestamp if the file exists
|
/** Create a new file or update the timestamp if the file exists
|
||||||
* @param string $filename the filename
|
* @param string $filename the filename
|
||||||
* @param int $time the timestamp to use (actual timestamp if not defined)
|
* @param int $time the timestamp to use (actual timestamp if not defined)
|
||||||
|
|||||||
Reference in New Issue
Block a user