mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +00:00
dskspace() checks if directory could be opened
This commit is contained in:
parent
d653c516ea
commit
0c48b342a5
|
@ -329,11 +329,12 @@ function dskspace($dir) { /* {{{ */
|
||||||
if(is_file($dir)) {
|
if(is_file($dir)) {
|
||||||
$space = filesize($dir);
|
$space = filesize($dir);
|
||||||
} elseif (is_dir($dir)) {
|
} elseif (is_dir($dir)) {
|
||||||
$dh = opendir($dir);
|
if($dh = opendir($dir)) {
|
||||||
while (($file = readdir($dh)) !== false)
|
while (($file = readdir($dh)) !== false)
|
||||||
if ($file != "." and $file != "..")
|
if ($file != "." and $file != "..")
|
||||||
$space += dskspace($dir."/".$file);
|
$space += dskspace($dir."/".$file);
|
||||||
closedir($dh);
|
closedir($dh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $space;
|
return $space;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user