How to get the total size of a local hard disk?
mail at timgolden.me.uk
Mon Jun 15 15:53:57 CEST 2009
Paul Boddie wrote:
> On 15 Jun, 14:58, willgun <will... at live.cn> wrote:
>> How to get the total size of a local hard disk?
>> I mean total size,not free space.
> Which platform are you using? On a Linux-based system you might look
> at the contents of /proc/partitions and then, presumably with Python,
> parse the contents to yield a number of blocks for the hard disk in
> question. This quantity would then be converted into a more familiar
> One might expect something like PSI to support this kind of
> ...but I think it only really provides process-related information.
On Windows, WMI is nearly always the answer to these
kind of things (altho' since WMI is nearly always a
shell around other APIs there's usually some other way).
More information about the Python-list