Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: disk usage in windows

by jsprat (Curate)
on Jul 21, 2003 at 18:26 UTC ( #276390=note: print w/replies, xml ) Need Help??


in reply to disk usage in windows

Use the FileSystemObject, a wrapper around the API. It runs almost instantaneously. It's installed if you've got Windows Script Host installed. Here's an example:

#!perl use warnings; use strict; use Win32::OLE; my $fs = Win32::OLE->CreateObject('Scripting.FileSystemObject'); my $d = $fs->GetDrive('c:'); print $d->{TotalSize}, " total\n"; print $d->{FreeSpace}, " free\n"; print $d->{AvailableSpace}, " available\n"; print $d->{TotalSize} - $d->{FreeSpace}, " used\n"; __END__ Output on my system: 4446814208 total 2482372608 free 2482372608 available 1964441600 used

Replies are listed 'Best First'.
Re^2: disk usage in windows
by songahji (Friar) on Apr 13, 2005 at 19:56 UTC
    Thanks jsprat, it saves me a lot of run-time!

    I would ++ (but I spent them all)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://276390]
help
Chatterbox?
[Corion]: The code is 00000000, as always, no?
[GotToBTru]: I remember hearing about somebody misplacing a list of code phrases or something
[marto]: 12345
[GotToBTru]: the "nuclear codes" are in the case cuffed to the wrist of some guy
[LanX]: not always
[LanX]: it's up to the Supreme commander
[GotToBTru]: we don't have one of those ;)
[LanX]: commander in chief whatever

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2017-01-20 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.