Folder junctions

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
MSpagni
Expert Member
Posts: 642
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Folder junctions

Post by MSpagni »

While comparing a couple of directories (including subdirs) I saw that the folder junctions present in a panel only are shown as standard "file folders" and "empty directories".
In reality those directories (I mean the directories "joined") were not empty but, since I had "process reparse points for subdirs" unchecked, that's ok.

N.B. Perhaps an indication that those are indeed folder junctions and not standard directories could be useful.

When I asked to copy those (officially empty) directories to the other panel, the copy copied also the contents of those directories.
If I had "process reparse points for subdirs" checked that's what I would have expected, but since it was unchecked I expected to simply replicate the presence of the empty directories in the other path.
Of course I'm not asking to create folder junctions, simply to create empty directories.

The matter is objectionable but I felt surprised by this behaviour.
User avatar
psguru
Site Admin
Posts: 2396
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Folder junctions

Post by psguru »

N.B. Perhaps an indication that those are indeed folder junctions and not standard directories could be useful.
I think you are right. We'll consider implementing this in a future version.
When I asked to copy those (officially empty) directories to the other panel, the copy copied also the contents of those directories.
If I had "process reparse points for subdirs" checked that's what I would have expected, but since it was unchecked I expected to simply replicate the presence of the empty directories in the other path.
Of course I'm not asking to create folder junctions, simply to create empty directories.
This, unfortunately, is not possible. EDPro uses the Shell API for file operations, and it is incapable of copying just a junction itself. See SHFileOperation API, and note the following from shellapi.h:

Code: Select all

#define FOF_NORECURSEREPARSE       0x8000  // deprecated; the operations engine always does the right thing on FolderLink objects (symlinks, reparse points, folder shortcuts)
The same "problem" exists when you copy a junction in Windows Explorer.
psguru
PrestoSoft
MSpagni
Expert Member
Posts: 642
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Re: Folder junctions

Post by MSpagni »

I just discovered that there is more about junctions.

In Win2000 (and, I'm told, in vista and seven too) if I delete a junction then the junction is deleted.
In XP if I delete a junction then the junction AND ALL THE ORIGINAL CONTAINED FILES are deleted!

I think a warning must be in order...

N.B. Thank you Microsoft! ("the operations engine always does the right thing on FolderLink objects", sic!)
MSpagni
Expert Member
Posts: 642
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Re: Folder junctions

Post by MSpagni »

Ooops!

[Windows 2000 caveats]
If the junction point is sent to the Recycle Bin, the targeted files will look safe, but will be deleted when the Recycle Bin is emptied.
User avatar
psguru
Site Admin
Posts: 2396
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Folder junctions

Post by psguru »

I'm not sure what EDPro can do here. The deletion warning comes from the Shell, which I suppose may be different for different OSes.
psguru
PrestoSoft
MSpagni
Expert Member
Posts: 642
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Re: Folder junctions

Post by MSpagni »

Well, I think that simply be aware that you're dealing with a junction can be enough.
That is: if you're using them then I'm allowed to think you know them!

A way to tell if it's a junction could be to show the 'J' attribute in the attribute list and/or show "junction" in the file type (if it doesn't slow the things down too much), but showing the attributes and/or the file type is optional and anyway it can be easily overlooked.

I leave to your imagination which way to use to make it apparent.

N.B. I know that "attributes" and "file type" (one of the most useless definition I can think of, but since the column "extension" is no more allowed...) are usually handled by windows itself, so it could be a PITA to change them.
Post Reply