
FishMonger
Veteran
Apr 18, 2009, 5:39 AM
Post #12 of 19
(3144 views)
|
|
Re: [DrRob] loss of readdir function with vista
[In reply to]
|
Can't Post
|
|
This is the method I'd use.
#!/usr/bin/perl use strict; use warnings; use File::Find; my (@files, @folders); find({ wanted => \&read_folder, no_chdir => 1 }, 'c:/testing'); sub read_folder { return if $_ =~ /^\./; push @files, $_ and return if -f $_; push @folders, $_ and return if -d $_; } print "Files:\n"; print "$_\n" for @files; print "\nFolders\n"; print "$_\n" for @folders;
(This post was edited by FishMonger on Apr 18, 2009, 5:41 AM)
|