|
I
don't think you need the backslash at the end. Here is the code I was
using, and it works okay from here:
use Win32::Lanman;use Win32::Adminmisc; use strict; use warnings; my $client = "c014193a"; my @driveinfo; getDDInfo($client,\@driveinfo) || die; foreach(@driveinfo){ print join("\t",($_->{name},$_->{capacity},$_->{space},$_->{percent}."\%"))."\n"; } sub getDDInfo{ my $client = $_[0]; my @drives; Win32::Lanman::NetServerDiskEnum("\\\\$client",\@drives) || return 0; foreach my $drive(@drives){ $drive =~ s/\://g; @drvinfo = Win32::AdminMisc::GetDriveSpace("\\\\$client\\$drive\$") or next; my $capacity = sprintf("%5.2f",($drvinfo[0]/1073741824)); #Convert to GigaBytes my $space = sprintf("%5.2f",($drvinfo[1]/1073741824)); my $percent; $space =~ s/\s//; $capacity =~ s/\s//; unless($capacity < .01){ $percent = sprintf("%.02f",$space / $capacity * 100); } push @{$_[1]},{name => $drive, capacity => $capacity, space => $space, percent => $percent}; } return 1; }
|
Title: Message
- getting remote hard drive space Sumit
- RE: getting remote hard drive space Rob Dowell
- Re: getting remote hard drive space Patrick J. LoPresti
- RE: getting remote hard drive space Tim Johnson
- RE: getting remote hard drive space John Giordano
- RE: getting remote hard drive space lgbarr
