Long paths do not require the \\?\
prefix to work[âŚ]
Without that prefix, support for long paths NEEDS to be enabled in Windows 10 and the MS-docs are REALLY clear about that:
To enable the new long path behavior, both of the following conditions must be met:[âŚ]
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later
There are hundreds of other resources saying exactly the same and lots of other projects dealing with exactly the same issues in the same way. Not sure what you actually tested, but you might simply have a wrong impression:
The keyâs value will be cached by the system[âŚ]
Keep additionally in mind that Windows internally sometimes rewrites paths to use shorter 8.3-notation maintained in the background as well. Another reason why things might look like they succeed, while itâs actually not the desired behaviour.
Additionally, for some reason this concrete group policy doesnât seem to have a default value. So once that setting has been enabled, if one puts it back to ânot configuredâ afterwards, the enabled(!) value persists. One needs to explicitly choose âdisabledâ, which disables the option AND afterwards ânot configuredâ keeps things disabled. So you most likely simply didnât test what you expected to test.
Use something like âcmd.exeâ instead, that can be closed and started with the group policy setting changed without the need to restart the whole system. You can easily test an enabled vs. disabled option using the following in a new cmd.exe:
cd C:\Users\tschoening\Downloads\sublime\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
That either succeeds or fails, depending on the group policy setting.
Looking at the manifest file of your Sublime-Exe, I donât understand how this can even work at all, because your manifest simply lacks the additional necessary option:
<ws2:longPathAware>true</ws2:longPathAware>
vs. Sublime Text 3:
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
vs. cmd.exe:
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
<windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
</windowsSettings>
</application>
Therefore it makes totally sense that long paths donât work properly for me, even after enabling the new setting. The following happens when opening a file in the formerly mentioned long directory:
Sublime wasnât able to open the file properly and instead only recognized it existed, but couldnât read its content.