> I am clueless how to do a directory list starting at the very root
> "Computer" which includes all drives.
> 
> What I am doing to get a directory tree is this:
> my $directory = "";
>     opendir DIR, $directory;
>     my @files = readdir DIR;
>     closedir DIR;
> 
> But it only start at one drive - not all drives. I am missing out on where
> to start the initial directory.
> 
> My main goal is to get all the drives on my computer, so I can do a
> directory tree on those drives.
        
use Win32::FileOp;

my %drives = Win32::FileOp::Substed();

while (my ($drive, $path) = each %drives) {
        if ($path) {
                print "Network/substed drive $drive -> $path\n";
        } else {
                print "Local drive $drive\n";
        }
}

Jenda
P.S.: Keep in mind that there is an often overlooked posibility to 
assign a drive letter to a directory on another drive!
===== je...@krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to