in reply to Win32::Perms Remove method

I think that instead of trying to do the recursion yourself, you ought to be looking at using the SetRecurse() method. This is a sample supplied with the package (see ..\perl\site\lib\win32\perms\recurse.pl)

use Win32::Perms; $Dir = 'd:\temp' unless( $Dir = $ARGV[0] ); $P = new Win32::Perms( $Dir ); # Set the all of the files called *.tmp in the specified directory $P->SetRecurse( "$Dir/*.tmp" ); print "Finished\n";


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail

Replies are listed 'Best First'.
Re^2: Win32::Perms Remove method
by Discipulus (Canon) on Jun 15, 2004 at 09:31 UTC
    thanks perlyfull BrowserUK,

    I use the tachyon recurse that I love a lot:
    my $root = 'c:/prova/'; my @dirs = ($root); my @files; for my $path (@dirs){ opendir ( DIR, $path ) or next; # skip dirs we can't read while (my $file = readdir DIR) { next if $file eq '.' or $file eq '..';# skip dot files next if -l $path.$file; # skip sym links if ( -d $path.$file ) { push @dirs, $path.$file.'/'; # add dir to list } else { push @files, $path.$file; # add file to list } } closedir DIR; }
    I never noticed this SetRecurse method. But the core of the problem remain. loves Lor*
      But the core of the problem remain.

      What does this mean?

      If you mean that you are still getting hangs when using a single Win32::Perms object recursively, then I would suggest that that is the source of your problem.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail