Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Now it's getting sad/worrisome/interesting. With my old 5.26 Perl, your script above reports empty arrays as expected (and, as a side note, some reasonable content if run with administrative rights). Also, I finally did mega-stress-test (sweep C:/ for 100 times), it completes OK.

Then I tried latest recommended Strawberry Perl versions 5.30.2.1, 5.28.2.1, 5.26.3.1, -- under 5.28 and 5.30 results are as you report: random bytes/single characters for "protected operating system" (as MS UI calls them) folders. The "mega-test" (tried once) hung on 5th sweep, though I was able to ctrl-C it. So, definitely looks like a bug (somewhere in Win32::LongPath XS guts?).

Update. Actually, the bug is not related to "special system" directories, and I'm no longer sure Win32::LongPath under 5.26 behaved correctly, too. Maybe the call to opendirL shouldn't succeed in the first place.

>perl -v This is perl 5, version 30, subversion 2 (v5.30.2) built for MSWin32-x +64-multi-thread Copyright 1987-2020, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. >mkdir abc >perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon +gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}" [".", ".."] [".", ".."] [".", ".."] [".", ".."] [".", ".."] >icacls abc /deny Everyone:F processed file: abc Successfully processed 1 files; Failed processing 0 files >perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon +gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}" ["\b"] ["\b"] ["\35"] ["\32"] ["'"] >perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon +gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}" ["\3"] ["\26"] ["#"] ["\22"] [4] >perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon +gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}" ["M"] ["~"] ["M"] ["w"] ["I"] >perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon +gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}" ["M"] ["}"] ["C"] ["l"] ["}"] >icacls abc /remove:d Everyone processed file: abc Successfully processed 1 files; Failed processing 0 files >perl -MData::Dump -MWin32::LongPath -E "for (1..5) {my $lp=Win32::Lon +gPath->new; $lp->opendirL('abc') or die; dd [$lp->readdirL]}" [".", ".."] [".", ".."] [".", ".."] [".", ".."] [".", ".."] >rmdir abc >

In reply to Re^5: Function to sweep a file tree (UPDATED) by vr
in thread Function to sweep a file tree by bojinlund

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-19 23:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found