Add limited support for long pathnames on the command line (#15828)#17440
Open
mgroeber9110 wants to merge 1 commit intonotepad-plus-plus:masterfrom
Open
Add limited support for long pathnames on the command line (#15828)#17440mgroeber9110 wants to merge 1 commit intonotepad-plus-plus:masterfrom
mgroeber9110 wants to merge 1 commit intonotepad-plus-plus:masterfrom
Conversation
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.
This is my first attempt at implementing the idea I mentioned in #15828 for a "cheap" way of adding initial support for long (>260) pathnames to the code. I have been using a similar workaround in an external batch file for some time now, and it has turned out to be useful enough for my case.
This change does two things:
GetShortPathNamefunction to retrieve a path using 8+3 names instead of the written-out forms. Because Notepad++ is not marked as long-path-aware in the manifest, this requires prefixing paths temporarily with either\\?\(for local drives) or\\?\UNC\(for UNC paths) to request long path support.This still does not cover all possible cases, as paths may still be too long even after the shortening (or some file systems might not have short names at all), but it has the advantage of requiring minimal code changes, and fitting entirely into
relativeFilePathToFullFilePath.A future change could make the entire code long path proof, as @softmgr describes, and apply the shortening only to legacy plugins that may not be compatible with long paths.