Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not follow Reparse Points during copy #305

Closed

Conversation

schinagl
Copy link
Contributor

@schinagl schinagl commented Feb 15, 2022

Problem

Winfile follows Reparse Points during copy and tries to copy files more than once, which results in error message, that the files already exist

How to test

Download ln.exe from https://schinagl.priv.at/nt/ln/ln64.zip and place it in the same directory as the below .bat file.
Start TestCopyReparsePoint.bat from an administrative command prompt (or grant yourself the right to create symbolic links) in your e.g. temp directory.

It builds a structure like

├───1
└───sl
    ├───iLib
    │   ├───inc
    │   └───src
    ├───iLib_symlink
    │   ├───inc
    │   └───src
    └───zzz

Navigate to x:\sl in Winfile and copy it e.g. via Drag and CTRL to x:\1. You will receive no errors opposite to the original version, which tries to copy all files below x:\sl\iLib_symlink onto itself when it has copied x:\q\sl\iLib_Symlink to its destination.

Comments to the code

Basically there is one change and it builds up on the 'skip' feature in GetNetxPair() which was introduced with #303.
In general Winfile implements the simplest of all Reparse Point copy strategies, which I called the 'Splice' method. See also the explanation of Splice in the LinkShellExtension Docu.

Winfile does the 'Splice' pattern also for inner and outer reparse points. So this will only work for absolute symbolic links. Relaive symbolic links will be copied but point to 'something'. This can not be solved for Winfile, because it needs more sophisticated symlink resolving.

@schinagl
Copy link
Contributor Author

Solved with #303 due to #297 prerequisites

@schinagl schinagl closed this Feb 24, 2022
@schinagl schinagl deleted the dont_follow_reparse_points_on_copy branch February 28, 2022 19:43
@schinagl schinagl restored the dont_follow_reparse_points_on_copy branch April 7, 2022 11:49
@schinagl schinagl deleted the dont_follow_reparse_points_on_copy branch April 10, 2022 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant