Nobody <nob...@nowhere.com> writes:

> On Wed, 22 Sep 2010 00:31:04 +0200, Hellmut Weber wrote:
>
>> I'm looking for a possibility to access the partiton inforamtion of a
>> hard disk of my computer from within a python program.
>
> Have you considered parsing /proc/partitions?

One could also just read the partition table directly, it's on the
first sector usually. (Assuming a PC without a GUID partition
table...) The partition table is just 64 bytes at offset 446 into the
sector. In unixlikes you can just open the disk with file.open()...
Then again, unixlikes other than Linux have somewhat different ideas
about partitioning...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to