Page 1 of 1

Go to Mirror / Sister Folders in other Drives

Posted: 11 Oct 2013 05:32
by Yogui
Hi,
I have the same folder structure in my Pendrive, Local and Network Drives
(The pendrive is the Master set, XYplorer runs portable)
As the Drive letters change (per PC) and the structure is large Favourite folders wont work for me to quikly Navigate/Open New Tab from one Drive to the other/s
Can this be implemented?
Menu "Go" then submenu "Go to mirror in Drive..."
Then a small menu with the list of available paths that match the current one by are in an other drive.
So if the current path is "D:\GIS\Resources\Modules"
Any path thah exist and is like "?:\GIS\Resources\Modules" should be included in the list

If wanna make it even better in the menu show the [Drive label] so its easier to select the right one e.g.
[Portable] H:\GIS\Resources\Modules
[Network] Z:\GIS\Resources\Modules

Re: Go to Mirror / Sister Folders in other Drives

Posted: 11 Oct 2013 07:52
by highend
Easily achievable via scripting.

Code: Select all

    // Drive types: 2 = Removable | 3 = Fixed | 4 = Remote
    $partialCurPath = substr("<curpath>", 3);
    $localDrives = get("drives", 3);
    $removableDrives = get("drives", 2);
    $networkDrives = get("drives", 4);

    $allDrives = $localDrives . "|" . $removableDrives . "|" . $networkDrives;
    $allDrives = formatlist(replace($allDrives, substr("<curpath>", 0, 3)), "e");

    $selectList = "";
    foreach ($drive, $allDrives, "|") {
        if (exists($drive . $partialCurPath) == 2) {
            if ($localDrives LikeI "*$drive*") {
                $selectList = $selectList . "[Local] $drive$partialCurPath" . "<crlf>";
            } elseif ($removableDrives LikeI "*$drive*") {
                $selectList = $selectList . "[Portable] $drive$partialCurPath" . "<crlf>";
            } elseif ($networkDrives LikeI "*$drive*") {
                $selectList = $selectList . "[Network] $drive$partialCurPath" . "<crlf>";
            }
        }
    }
    if ($selectList) {
        $selectedPath = inputselect("Choose your path...", $selectList, "<crlf>", 4);
        $selectedPath = replacelist($selectedPath, "[Local] |[Portable] |[Network] ", "", "|");
        tab("new", $selectedPath);
    } else {
        status "$partialCurPath not found on any other volume, aborted!", "FF0000", "stop";
    }

Re: Go to Mirror / Sister Folders in other Drives

Posted: 11 Oct 2013 14:01
by Yogui
:appl: Thanks for that!
Still need a minor improvement with the current Drive (removed) that still show in the input select
How does it handle the \\NetworkAddress and Desktop, Computer etc CLSID List (Windows Class Identifiers) paths?
It should fail (nicely) since there is no Mirror Folder Structures