mirror of
https://github.com/clechasseur/pathcopycopy.git
synced 2026-04-25 12:15:58 +03:00
[GH-ISSUE #146] [FEATURE] Long Path Support #142
Labels
No labels
bug
duplicate
enhancement
enhancement
enhancement
fixed
help wanted
help wanted
invalid
pull-request
question
waiting for input
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/pathcopycopy#142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jimspoon on GitHub (Aug 20, 2021).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/146
Originally assigned to: @clechasseur on GitHub.
Even though I have LongPathsEnabled with this registry key, [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001
the Copy File/Folder Path context menu option returned only the Folder path, not the File path, when the total path was 292 characters.
It would be good to have paths > 260 characters enabled.
@clechasseur commented on GitHub (Aug 20, 2021):
Interesting. I would've thought the shell would take care of this properly... obviously I'm doing something wrong.
@jimspoon commented on GitHub (Aug 21, 2021):
I'm not a programmer but while researching this issue I found this about an application manifest -
The application manifest must also include the longPathAware element.
XML
Copy
ws2:longPathAwaretrue</ws2:longPathAware>
https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd
No idea if this helps at all but I thought I'd send it your way!
@clechasseur commented on GitHub (Aug 21, 2021):
It does help, actually. I'll try it locally and see if it works.
@clechasseur commented on GitHub (Aug 28, 2021):
@jimspoon I have tried enabling long path support through the registry key, but am still unable to create a path longer than MAX_PATH in Windows Explorer. I am on Windows 10 20H2 so it should be supported. Is it supposed to work in Windows Explorer at all or are you using a different shell program? If Windows Explorer is not long path aware, I fear that Path Copy Copy might be difficult to convert too...
@clechasseur commented on GitHub (Aug 28, 2021):
After doing some Googling, it does seem that Windows Explorer does not support long paths yet. I can still look into this but it is doubtful that Path Copy Copy will be able to support it if the shell doesn't...
@jimspoon commented on GitHub (Aug 28, 2021):
Hi Clechasseur, a single component of the path (a filename or a folder name) still must be 255 characters or less. But you should be able to string a bunch of these components together to have a folder name up to 32767 characters long.
"The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\?" prefix. For example, "\?\D:\very long path"."
https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd
@clechasseur commented on GitHub (Aug 28, 2021):
@jimspoon I tried that and it doesn't work in Windows Explorer. I created two folders deep whose name are 100 characters each. Inside the second folder, I cannot create a file whose name would make the path go beyond MAX_PATH (e.g. 260 characters).
Are you able to do it in Windows Explorer on your own system?
@jimspoon commented on GitHub (Aug 28, 2021):
Well I just tried it and you are right! I had the registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled (Type: REG_DWORD) set to 1. I did exactly the same thing you did and I couldn't make a third 100 character folder name that would have extended the path longer than 260. Oddly enough Voidtools Everything has no problem with it. Also the latest version of Advanced Renamer 3.88 can do it too.
I mentioned this in the Voidtools forum and the author gave a response that might be helpful - https://www.voidtools.com/forum/viewtopic.php?f=2&t=10417
@clechasseur commented on GitHub (Aug 28, 2021):
Gonna leave some useful links here:
https://stackoverflow.com/questions/53918205/how-to-enable-long-path-aware-behavior-via-manifest-in-a-c-executable
https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests
@clechasseur commented on GitHub (Aug 28, 2021):
I've done my best to support long pathnames. With the latest build, it's possible for me to copy the full path of a file whose path is 267 characters long when choosing "Copy long path".
Will be available in the next major version.