swissknife has asked for the wisdom of the Perl Monks concerning the following question:
HEllo Experts,
I am trying to get size of all the folders in a network drive on windows and using following codes but no success.
use strict; use warnings; use File::stat; my @scoll; #my $path = "c:\\temp\\"; my $path = "\\\\domain.local\\users\\"; opendir DIR, $path or die $!; my @alldir = readdir DIR; closedir DIR; foreach my $eachdir (@alldir) { my $cpath = $path . $eachdir; #print $cpath; my $sEachDir = stat($cpath)->[7]; push (@scoll, $sEachDir); } print "@scoll\n";
$eachdir can print all the subfolders available in network drive, however size printed will be 0. when i tried with local drive for example c:\temp, it shows the correct size of folders but not when setting path to a network location
Can you suggest something?
-swissknife-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: size of all subfolder from a network location
by Mr. Muskrat (Canon) on Jun 05, 2014 at 20:44 UTC | |
|
Re: size of all subfolder from a network location
by poj (Abbot) on Jun 05, 2014 at 17:57 UTC | |
|
Re: size of all subfolder from a network location
by locked_user sundialsvc4 (Abbot) on Jun 05, 2014 at 18:12 UTC |