rendered paste body#
if(!$_GET["dir"]) {
#
if (is_dir($base)) {
#
if ($dh = opendir($base)) {
#
echo "<pre>";
#
while (false !== ($file = readdir($dh))) {
#
if(is_file($base.$file)) {
#
$link = "?p=dump&file=".$file;
#
} elseif(is_dir($base.$file)) {
#
$link = "?p=dump&dir=".$file;
#
}
#
$orgf = $file;
#
if(strlen($file) > 65) {
#
$file = substr($file, 0, 65);
#
$file .= "...";
#
}
#
echo "<a class='dump' href='{$link}'>"; string_fixed_length_reverse(10, string_fixed_length(70, $file, 1).human_file_size(filesize($base.$orgf)), 1); echo "</a>\n";
#
}
#
echo "</pre>";
#
closedir($dh);
#
} else {
#
msg("Error", "cant open the directory");
#
}
#
} else {
#
msg("Error", "cant find the directory");
#
}
#
}