[Lazarus] Long paths manifest

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Long paths manifest

Free Pascal - Lazarus mailing list
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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Long paths manifest

Free Pascal - Lazarus mailing list
--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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Long paths manifest

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list

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


On 13/11/2018 07:49, Denis Kozlov wrote:

> 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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Long paths manifest

Free Pascal - Lazarus mailing list
On 20.11.2018 1:17, Denis Kozlov via lazarus wrote:
> Any thoughts on integrating

I'm making the patch. I dont know on which XML level to insert new XML
part - inside <assembly> or out of it in the root?

<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>

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Long paths manifest

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
https://bugs.freepascal.org/view.php?id=34573

my attempt. I'm not sure about correct place of XML option. I did it
like this page shows:

https://gist.github.com/riverar/196d5aa6bb53bbdfb50beb323d0709df . So
pls check it in work.

AT

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus