How to change MAX_PATH value?

How to change MAX_PATH value?

am 28.11.2007 09:39:09 von sonet

I need write data to a file that filename length > 255.




Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=de
fine
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef

Re: How to change MAX_PATH value?

am 05.12.2007 00:23:28 von Ilya Zakharevich

[A complimentary Cc of this posting was sent to
sonet
], who wrote in article :
> I need write data to a file that filename length > 255.

Which filesystem? Definitely not FAT or NTFS... Or the NTFS
restriction of 255, is it per-component-of-filename, or
whole-filename?

> Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
> Platform:
> osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread

If your filesystem supports this, did you try UNC paths, like

\\.\LONG_FILE_NAME

I've heard that the newer MS kernels support these...

In short, I doubt it is a Perl limitation (but I know close to 0 about
Win*...).

Hope this helps,
Ilya

Re: How to change MAX_PATH value?

am 05.12.2007 00:36:17 von Ilya Zakharevich

[A complimentary Cc of this posting was NOT [per weedlist] sent to
Ilya Zakharevich
], who wrote in article :
> [A complimentary Cc of this posting was NOT [per weedlist] sent to
> sonet
> ], who wrote in article :
> > I need write data to a file that filename length > 255.
>
> Which filesystem? Definitely not FAT or NTFS... Or the NTFS
> restriction of 255, is it per-component-of-filename, or
> whole-filename?

I see (on WPedia):

the file system supports paths up to about 32,000 Unicode characters
with each path component (directory or filename) up to 255
characters long

So if your compiler was stupid enough to define MAX_PATH as 255, you
are hosed. Although very few places of perl will actually use it, so
if the CRTL is able to get/put short files, you are in business.

If everything else fails, write a short program which opens STDOUT to
the file, and starts your script. Eg, if your shell supports longer
file names, start your script as

yourscript.pl > long_file

Hope this helps,
Ilya