Could the PairedFolder object add a property to show whether a nonexistent folder action was taken. My use case is for deciding whether it is okay to link the paired tab. I only want to do that if the requested pair path exists.
Wouldn't this be the job of FSUtil.Exists()
?
My problem occurs when If non-existent:
is set to Go up to first existing parent
. For example, if C:/Test is paired with D:/Test and Apply setting to all sub-folders
is turned on then opening C:/Test/NoMatchInPair returns a valid pair of D:/Test (the parent). I only want to link folders that exist in both locations.
Hmm, yeah, I don't think you have any way of knowing what the original matched path was, as the object will return the parent path if that's where it ultimately ended up (when configured to do so).
My simple test, FWIW:
C:\ProgramData
exists but D:\ProgramData
doesn't.
The PairedFolder object for C:\ProgramData
pairs it with D:\
(which makes sense; it's where the lister would go),
var fsu = DOpus.FSUtil;
var pair = fsu.GetFolderPair("C:\\ProgramData");
var otherPath = pair.path;
if (fsu.Exists(otherPath))
{
DOpus.Output("Exists: " + otherPath);
}
else
{
DOpus.Output("Doesn't exist:" + otherPath);
}
I haven't looked at the code yet, but maybe we can add a property that tells you the original matched path, before any existence checks and parenting was done, as well as a flag saying if the path was changed. I've added that to the list.
13.9.8 adds the parent_level
which will return >0 if the initial folder didn't exist.