Skip to content

Instantly share code, notes, and snippets.

@xaicron
Created January 23, 2011 17:54
Show Gist options
  • Save xaicron/792274 to your computer and use it in GitHub Desktop.
Save xaicron/792274 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Win32::Unicode;
my $dir = '.';
my_find($dir);
sub my_find {
my ($dir) = @_;
chdirW $dir or die "$dir: $!";
sayW "dir: $dir";
my $wdir = Win32::Unicode::Dir->new;
$wdir->open('.');
my @files = $wdir->fetch;
$wdir->close;
sayW join "\n", map { "[$_]" } @files;
for my $file (@files) {
next if $file =~ /^\.{1,2}$/;
next unless file_type d => $file;
my_find($file);
chdirW '..' or die "$file/../: $!";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment