develooper Front page | perl.perl5.porters | Postings from May 2017

Long path names on Windows

Thread Next
From:
Zakariyya Mughal
Date:
May 9, 2017 03:11
Subject:
Long path names on Windows
Message ID:
20170509031121.q2kt7p3gaeyyidny@simulo
Hello,

Has there been any progress on supporting long path names on Windows? I
noticed that there have been changes in Windows 10 that let you opt-in
to bypassing the `MAX_PATH` limit by setting up a manifest and registry
key:

- <https://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath>
- <https://blogs.msdn.microsoft.com/jeremykuhne/2016/07/30/net-4-6-2-and-long-paths-on-windows-10/>

(spotted on the Python bug tracker <https://bugs.python.org/issue18199>,
<https://bugs.python.org/issue27731>).

However, it seems that these changes depend on using the wide-char
versions of the API functions. I see that there is already an issue for
this here <https://rt.perl.org/Public/Bug/Display.html?id=60888> (and
the associated meta issue for Unicode and system calls
<https://rt.perl.org/Public/Bug/Display.html?id=105914>).

If this can not be done yet, it might be useful to catch the error when
calls like open() fail on Windows. Right now the output of accessing a
long file path on Windows looks like this:

```perl
use autodie;
open($long_path);
```

```output
Can't open('$long_path'): No such file or directory
```

When I use built-in commands like `dir`, it tells me: `The filename or
extension is too long.` which is more informative.

Cheers,
- Zaki Mughal

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About