HashCheck icon indicating copy to clipboard operation
HashCheck copied to clipboard

[Feature Request] Long Path Support

Open tERyceNzAchE opened this issue 4 years ago • 4 comments

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

tERyceNzAchE avatar Mar 07 '21 17:03 tERyceNzAchE

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.

tERyceNzAchE avatar Mar 22 '21 16:03 tERyceNzAchE

Any update here?

yjlin0224 avatar Apr 06 '21 14:04 yjlin0224

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.

idrassi avatar Sep 26 '21 20:09 idrassi

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>

ThomasCr avatar Oct 03 '23 19:10 ThomasCr