in reply to Re: Trying to get drive space info on remote Windows servers
in thread Trying to get drive space info on remote Windows servers
If I run it against the server specified in the line that's commented out, it returns zeroes and no error. If I run it against my C:, it returns accurate numbers. So I don't think it's going out to the network, yet it isn't returning an error.use Win32::DriveInfo; use constant { SECTORS_PER_CLUSTER => 0, BYTES_PER_SECTOR => 1, FREE_CLUSTERS => 2, TOTAL_CLUSTERS => 3, BYTES_FREE_4_CALLER => 4, TOTAL_BYTES => 5, TOTAL_FREE => 6, }; #$sql = "\\\\server01\\d\$"; $sql = "c:"; print "$sql\n"; print "Drive Free Tot PctFree\n"; my @info = Win32::DriveInfo::DriveSpace($sql) or die "DriveSpace failed with error: $^E"; printf "%.3f GB free of total %.3f GB\n", $info[ TOTAL_FREE ] / 1024**3, $info[ TOTAL_BYTES ] / 1024**3;
c:\Perl>drivelist.pl \\server01\d$ Drive Free Tot PctFree 0.000 GB free of total 0.000 GB c:\Perl>drivelist.pl c: Drive Free Tot PctFree 31.639 GB free of total 74.444 GB
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Trying to get drive space info on remote Windows servers
by BrowserUk (Patriarch) on Feb 18, 2010 at 18:32 UTC | |
by Cloudster (Novice) on Feb 19, 2010 at 06:12 UTC | |
by BrowserUk (Patriarch) on Feb 19, 2010 at 09:29 UTC | |
by Cloudster (Novice) on Feb 19, 2010 at 15:09 UTC | |
by Cloudster (Novice) on Feb 19, 2010 at 20:02 UTC | |
|
Re^3: Trying to get drive space info on remote Windows servers
by revhippie (Scribe) on Feb 18, 2010 at 18:27 UTC |