Current working directory: Root/'; if (!empty($work_dir_splitted[0])) { $path = ''; for ($i = 0; $i < count($work_dir_splitted); $i++) { $path .= '/' . $work_dir_splitted[$i]; printf('%s/', $PHP_SELF, urlencode($path), $work_dir_splitted[$i]); } } ?>
Choose new working directory: Current Directory\n"; } elseif ($dir == '..') { /* We have found the parent dir. We must be carefull if the parent directory is the root directory (/). */ if (strlen($work_dir) == 1) { /* work_dir is only 1 charecter - it can only be / There's no parent directory then. */ } elseif (strrpos($work_dir, '/') == 0) { /* The last / in work_dir were the first charecter. This means that we have a top-level directory eg. /bin or /home etc... */ echo "Parent Directory\n"; } else { /* We do a little bit of string-manipulation to find the parent directory... Trust me - it works :-) */ echo "Parent Directory\n"; } } else { if ($work_dir == '/') { echo "$dir\n"; } else { echo "$dir\n"; } } } } closedir($dir_handle); ?>
Command:
Enable stderr-trapping?
stderr