Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: hard drive space

by bmann (Priest)
on Oct 03, 2007 at 00:57 UTC ( #642273=note: print w/ replies, xml ) Need Help??


in reply to Re: hard drive space
in thread hard drive space

Here's another Win32 specific method using windows scripting FileSystemObject:

use warnings; use strict; use Win32::OLE; my $fso = Win32::OLE->CreateObject('Scripting.FileSystemObject'); my $drive = $fso->GetDrive('C:'); my $free = $drive->{FreeSpace}; my $size = $drive->{TotalSize}; printf "disk size = %d MB\n", $size/(1024*1024); printf "disk free = %d MB\n", $free/(1024*1024);


Comment on Re^2: hard drive space
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://642273]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2015-07-05 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls