Junctions not recognized on Move, source contents deleted

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Yes, I'd definitely prefer the options I requested above, clarification for option [0].

Options in .ini:
CopyMoveFollowJunction=0|1|2
CopyMoveFollowHardlink=0|1|2

0: Do Not reparse, create a new Valid Junction|Hardlink if possible.
Copy/Move Junctions wrote:
  1. Copy(or Move) the Source Junction (do not create Folders).
  2. If a tracked junction's real folder was copied (or moved) in the same operation:
  3. Repoint the Target Junction to the Target Drive.
# If a Hardlink cannot be created, due to different Volume, then a copy is created.
In win7/Vista, Symlinks are supported, that can traverse different volumes.
Example 1 wrote:C:\Folder3 -> C:\A Folder\3 Levels\Deep
Copy C:\Folder3 to D:\,
Results in: D:\Folder3 -> C:\A Folder\3 Levels\Deep
Example 2 wrote:If I copy C:\Folder3 AND C:\A Folder to D:\
Results in: D:\Folder3 -> D:\A Folder\3 Levels\Deep
REAL Example 3 wrote:C:\Program Files (x86)\_Audio --> C:\mntHD\HDa0\ALLxx_BIN\_Audio

Where HDa0 is a mountPoint to a partition with no Drive Letter assigned.

Currently, if I Copy my C drive all of the Junctions within the ProgramFiles(x86) will be created as Directories and their contents reduplicated.

With option [0] above, my copy should contain junctions that point to C:\mntHD\HDa0\ALLxx_BIN\_Audio.
1: Reparse and always Copy contents to new Location.
If action is a Move operation, contents are copied instead.
2: Reparse and allow Move to new Location.
#If action is a Move operation, contents are moved.
#If file has hardlink clones, moving it to another Volume will break the clones,
this should be disallowed. A copy is done instead.
Likewise, One should be able to override these option/defaults within the Copy/Move dialog, like the current Advanced DropDown menu. A secondary Advanced/Junction drop down would be highly appreciated.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You can't ignore junctions in the normal copy functions, but you can in "synchronize dirs". Please add the following under [Configuration] to your wincmd.ini:

SyncIgnoreJunctions=1
Author of Total Commander
https://www.ghisler.com
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Fixed? Try moving a Win7 user folder to another drive, and watch all the symlinks/junctions get turned into a normal folder and ALL of the data duplicated ad-nauseum.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

What else would you expect? TC cannot simply copy the links, because
1. Their targets may not be copied too, or
2. Their targets may be copied at a later time than the links, and
3. Linking to the original files (source disk) would be useless...
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Anyway we need an option to choose what to do with links:) e.g. if I copy/move folder from one local drive to another (or to same one), I may want to have links copied. :)
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

When we copy a Folder that contains junctions to another drive:
All the junctions are converted to folders, ALL the data is duplicated.

When we move a Folder that contains junctions to another drive:
All the junctions are converted to folders, NONE of the data is duplicated.

When we copy a Folder that contains junctions to the same drive:
All the junctions are converted to folders, ALL the data is duplicated.

When we move a Folder that contains junctions to the same drive:
All the junctions are retained, but they are invalid/wrong path.

Three separate behaviours for MOVE/COPY depending on where it is being copy/moved to. None of the behaviours are particularly good. It has been mentioned numerous times on this board certain behaviours of TC are implemented to prevent data loss --- even though some of TC's feature implementation cause data loss.

This is one such case that causes data loss, it does not prevent it. Directory structures are changed, data is copied that shouldn't be and/or junctions wind up broken.

If you would like to see how things should possibly be implemented, then you would want to look at Link Shell Extension's, Clones, or SmartMove, or SmartCopy.

I have written a BatchScript and AHK Script to likewise safely move/copy folders and create new VALID junctions instead of converting them to folders, duplicating files or leaving them in an invalid state.

Yet I really shouldn't have to try and remember that a folder might contain a junction and need to switch to a script instead of being able to trust that TC will actually copy or move the files as it would for any other folder.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Balderstrom wrote:When we move a Folder that contains junctions to the same drive:
All the junctions are retained, but they are invalid/wrong path.
Actually junctions keep their original path, which is not always wrong - it depends on path. If path was pointing to moved folder, it becomes wrong, but if path was pointing to external folder, it remains valid.
Post Reply