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