Cloudster has asked for the wisdom of the Perl Monks concerning the following question:
use Win32::DriveInfo; print "$s_c\n"; print "Drive Free Tot PctFree\n"; ($SectorsPerCluster, $BytesPerSector, $NumberOfFreeClusters, $TotalNumberOfClusters, $FreeBytesAvailableToCaller, $TotalNumberOfBytes, $TotalNumberOfFreeBytes) = Win32::DriveInfo::DriveSpace('\\\\server01\ +\c\$'); $fb = $TotalNumberOfFreeBytes / 1024 / 1024 / 1024; $tb = $TotalNumberOfBytes / 1024 / 1024 / 1024; #$pctfree = $fb / $tb; print "$s_c: $fb $tb $pctfree\n"; $TotalNumberOfBytes = (Win32::DriveInfo::DriveSpace('\\\\server01\\d\$ +\\'))[5]; $TotalNumberOfFreeBytes = (Win32::DriveInfo::DriveSpace('\\\\server01\ +\d\$\\'))[6]; $fb = $TotalNumberOfFreeBytes / 1024 / 1024 / 1024; $tb = $TotalNumberOfBytes / 1024 / 1024 / 1024; #$pctfree = $fb / $tb; print "$s_d: $fb $tb $pctfree\n";
|
|---|