Repository navigation
Conversation
Contributor
Author
|
Contributor
Author
|
@CatsDeservePets I think this is now a solid and significant improvement of the file operations that make things more resilient It would be great if you could help test this for a wile to make sure I didnt overlook anything. I know its a larger change but this is the only clean solution that didnt open up new issues when trying o fix the preserver option. |
valoq
marked this pull request as ready for review
October 4, 2026 22:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #2688
The copy operation used full path names and resolved them again at every step and also followed encountered symlinks.
Symlinks could be swapped between the checks (which is especially an issue when lf is running as root and coping to a user owned directory)
Copying now works through open directory handles and the symlink issues are avoided.
The solution is modeled after coreutils cp approach, with some (better) changes enabled by golang os.root
This should be tested for a while and get a critical review
Edit:
this also fixes the bug with the preserve=mode option since it touched a lot of related code and no longer made sense to split.