in reply to Re^2: Filenames beyond 260 chars in Perl on WinXP
in thread Filenames beyond 260 chars in Perl on WinXP

You are not being very generous. Perl is written in C, and the C standard defines a constant FILENAME_MAX which is set to 260 in the Microsoft header files.

There is another Microsoft specific constant called MAX_PATH, and to quote the MSDN: "In the Windows API, the maximum length for a path is MAX_PATH, which is defined as 260 characters."

Exceptions are when using the Unicode interfaces and WCHARS, as you imply, which give a theoretical filename maximum of 32,767 characters. The sting in the tail of using such filenames is that there are several Microsoft APIs that do not support them; quoting the MSDN again: "It is possible to create a path with the Windows API that the shell user interface might not be able to interpret properly.". I don't think it is unreasonable that supporting such filenames has not been a priority.
  • Comment on Re^3: Filenames beyond 260 chars in Perl on WinXP

Replies are listed 'Best First'.
Re^4: Filenames beyond 260 chars in Perl on WinXP
by ienne (Novice) on Nov 08, 2009 at 14:27 UTC

    My apologies--I did not mean to be ungenerous to Perl, which has helped me solving quite a bit of issues efficiently and elegantly with limited effort, nor to the developers, who make a splendid job. Yet, I use both various forms of Unix (well, lately it is Linux) and WinXP, and I find in the latter some limitations which seem to come right out of the '80s. The 260-char for a pathname is one of them, and probably I am not alone thinking it a bit ridiculous if the API supports "somehow" much longer lengths and the file system absolutely and perfectly does. I would have just found splendid if Perl could circumvent some of these "artificial" limitations, as it seems possible. But I agree--in the big picture it is probably a low priority and my search on the web suggests it is not a very common problem for people.

    To Corion: I'd love to, but I am too incompetent to even try. Even for my own purpose, I guess I will simply have to run the scripts on a Linux box.

    Thanks,

    p.