Update: Ahhh..did not read your last para prorperly. davidrw's suggestion should do it. If I understand it correctly $_ sets the current short name and not the absolute path so you might want to experiment with that number as the total path limitation could still be an issue...end update

I am not sure what is your file system but Windows has a limitation with the number of chars on the path.

I found this link which talks about how the Win32 API call can be made so that the path will be treated as a unicode. I tried to use it in Perl and did not work.

http://cert.uni-stuttgart.de/archive/bugtraq/2002/01/msg00376.html

I tried to create a deep path on my Windows XP pro. It did not get ver far

#!/usr/bin/perl -w my $path = "/monktemp"; chdir($path) or die "Cannot chdir to /monktemp: ($!)"; for (1..300) { mkdir("monk", 0755) or die "Cannot mkdir monk: $!"; chdir("monk") or die "Cannot chdir to monk: ($!)"; $path .= "/monk"; print ("Done Processing $_ levels: Path length so far =", length($ +path),"\n"); }

Output:

...... ...... Done Processing 45 levels: Path length so far =234 Done Processing 46 levels: Path length so far =239 Done Processing 47 levels: Path length so far =244 Cannot mkdir monk No such file or directory at createdir line 7.
I haven't looked at the Documentation for the exec method yet but not sure whether any non-system method can be made to go deeper than 255 char limitation!

cheers

SK


In reply to Re: File:Find::Rule on Win32 by sk
in thread File:Find::Rule on Win32 by puploki

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.