Getting partition size from perl script 
Author Message
 Getting partition size from perl script

What is the best way for a perl script to obtain the size of free space
on a partition?

r.f



Tue, 14 Oct 2003 04:10:07 GMT  
 Getting partition size from perl script
The following will work only on windows nt4 / 2000 with the Win32::AdminMisc
module installed.

use Win32::AdminMisc;
foreach ( Win32::AdminMisc::GetDrives(DRIVE_FIXED) )
{
print "\nSpace on $_ volume (Mbytes)\n","-" x28,"\n\n";

printf "Total : %.2f\n", $space[0]/(1024**2) ;
printf "Free  : %.2f\n", $space[1]/(1024**2) ;
printf "full  : %.2f%\n", (100-(100*($space[1]/$space[0])));

Quote:
}



Quote:
> What is the best way for a perl script to obtain the size of free space
> on a partition?

> r.f



Tue, 14 Oct 2003 05:42:20 GMT  
 Getting partition size from perl script

Quote:

> What is the best way for a perl script to obtain the size of free space
> on a partition?

> r.f

How stupid of me, I forgot, I am running Linux V5.6.0. Thanks for the
WinNT stuff, I'll hang onto it!

r.f



Tue, 14 Oct 2003 05:55:05 GMT  
 Getting partition size from perl script

<URL::">

Quote:
}}  What is the best way for a perl script to obtain the size of free space
}}  on a partition?

    system df => '-k';

Abigail
--
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;        
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";



Tue, 14 Oct 2003 06:20:41 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. (Q) getting a file's size in Perl

2. CGI.pm Bug: file upload file size mismatch when file size is close to buffer size

3. Getting Traffic Size in Bytes from W3C Extended Format Log

4. Getting NTFS Directory structure size

5. getting object size?

6. Getting Remote File Size

7. HELP! Getting Remote File Size

8. getting directory size

9. Getting File Size

10. Getting the size of the mail queue.

11. Getting image size

12. problem getting file size in forked code

 

 
Powered by phpBB® Forum Software