Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-11

Long paths manifest

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Denis Kozlov

Hello,

Windows API is capable of working with extended-length path for a maximum total path length of 32,767 characters, thus, overcoming the infamous 260 characters path limitation (a.k.a. MAX_PATH). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\C:\Very\Long\Path".

According to Windows Docs, one can enable the new long path behavior per app via the manifest:
-----------------------------
<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>
-----------------------------

Has anyone had any experience with embedding such manifest? What would be the best way to add such a manifest to an application, currently?

Perhaps this could be added as an option in Lazarus IDE, similarly to the option for enabling themes support.

For the reference:
Windows Docs - Naming Files, Paths, and Namespaces - Maximum Path Length Limitation
https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation

Regards,
Denis

Reply by email

AlexeyT
to Denis Kozlov

--File I/O functions in the Windows API convert "/" to "\" as part of converting the name to an NT-style name, except when using the "\\?\" prefix as detailed in the following sections.

So apps may have new bugs from this prefix. when app uses / shashes (fn
:= dir + '/' + name) by mistake.

Alex

Reply by email

Denis Kozlov
to Denis Kozlov: Windows API is capable of working with extended-length path for a maximum total path…

Any thoughts on integrating the long paths manifest into Lazarus as a project option?

Denis Kozlov wrote 33 lines
Hello, Windows API is capable of working with extended-length path for a maximum total path length of 32,767 characters, thus, overcoming the infamous 260 characters path limitation (a.k.a. MAX_PATH). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\C:\Very\Long\Path". According to Windows Docs, one can enable the new long path behavior per app via the manifest: ----------------------------- <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> ----------------------------- Has anyone had any experience with embedding such manifest? What would be the best way to add such a manifest to an application, currently? Perhaps this could be added as an option in Lazarus IDE, similarly to the option for enabling themes support. For the reference: Windows Docs - Naming Files, Paths, and Namespaces - Maximum Path Length Limitation https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation Regards, Denis

Reply by email