1024) { if ($tmp > 1048576) { if ($tmp > 1073741824) { if ($tmp > 1099511627776) { if ($tmp > 1125899906842624) { if ($tmp > 1152921504606847000) { if ($tmp > 1180591620717411300000) { $u="o";$tmp=$tmp/1180591620717411300000; } else { $u="e";$tmp=$tmp/1152921504606847000; } } else { $u="p";$tmp=$tmp/1125899906842624; } } else { $u="t";$tmp=$tmp/1099511627776; } } else { $u="g";$tmp=$tmp/1073741824; } } else { $u="m";$tmp=$tmp/1048576; } } else { $u="k";$tmp=$tmp/1024; } } else { $u=""; } return Round($tmp, 2)." ".strtoupper($u)."B"; } function rddir($dir) { /* v2.11 */ global $tfile,$tdir,$ij;$i=0;$j=count($tdir); if (is_dir($dir)) { if ($dh=opendir($dir)) { while (($file=readdir($dh)) !== false) { if (is_dir($dir.$file)) { if (($file != ".") && ($file != "..")) { $tdir[$j]=$dir.$file;$j++; } } else { $tfile[$i]=$file;$i++; } } closedir($dh); } } $ij=$i; } if (!isset($argv[1])) { echo "Usage: ".$_SERVER['PHP_SELF']." \n";die; } for ($tdir[0]=$argv[1],$r="",$s=$k=$i=0;$igetName();$s+=$file->getUnpackedSize(); _o("Extracting ".$_f[$k]." (".bytec($file->getUnpackedSize()).")..."); $file->extract($tdir[$i]); $k++; } rar_close($rar); _o("Deleting compressed files..."); _rm($tfile[$j]); } elseif ($x == "zip") { // zip $zip=new ZipArchive or die("Zip library not loaded"); if ($zip->open($tfile[$j]) === true) { $zip->extractTo($tdir[$i]); $zip->close(); _o("Deleting compressed files..."); _rm($tfile[$j]); } else { die("Can't open ".$tfile[$j]); } unset($zip); } } unset($tfile); } _o($k." files (".bytec($s).") extrated from ".$i." folders."); ?>