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

[Feature Request] Long Path Support #1

Open
tERyceNzAchE opened this issue Mar 7, 2021 · 4 comments
Open

[Feature Request] Long Path Support #1

tERyceNzAchE opened this issue Mar 7, 2021 · 4 comments

Comments

@tERyceNzAchE
Copy link

HashCheck does not currently support long path names (> 260 characters).

@tERyceNzAchE
Copy link
Author

Prefixing all path strings with \\?\ seems like a potential solution for Long Path Support.

Reference: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#maxpath

For file I/O, the "?" prefix to a path string tells the Windows APIs to disable all string parsing and to send the string that follows it straight to the file system. For example, if the file system supports large paths and file names, you can exceed the MAX_PATH limits that are otherwise enforced by the Windows APIs. For more information about the normal maximum path limitation, see the previous section Maximum Path Length Limitation.

@yujinlin0224
Copy link

Any update here?

@idrassi
Copy link
Owner

idrassi commented Sep 26, 2021

Windows Explorer doesn't yet support long path names (cf https://theitbros.com/destination-path-too-long-error-when-movingcopying-a-file and look for "Win32 Long Paths GPO Not Working on Windows 10 File Explorer"). HashCheck is a shell extension dll loaded by Explorer so Explorer limitations apply to it.

The only possibility is to use \?\ as indicated by @tERyceNzAchE in the hope there will be no issue when Explorer passes the long path to us. I have doubts it will work because Explorer fails to open such paths but it is worth testing.

I will do some tests and let you know.

@ThomasCr
Copy link

ThomasCr commented Oct 3, 2023

Have your read: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

There is a regirtry key which should do the trick?

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001

Maybe after also adding the app minifest with:

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
        <ws2:longPathAware>true</ws2:longPathAware>
    </windowsSettings>
</application>

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

No branches or pull requests

4 participants