Get drives and partitions list (Linux)

cantabile cantabile.03 at wanadoo.fr
Tue Jun 14 07:21:45 EDT 2005


Thanks for the answer and help.
Cheers  :)

Peter Hansen wrote:
> cantabile wrote:
> 
>> Hi, Peter
>> Thanks for the reply. I'll check popen().
>> But you said I should not rely on fdisk... Why ? And should I prefer
>> sfdisk ? Why ?
> 
> 
> I was under the impression that fdisk was older and more primitive, but
> a quick check shows I'm probably not only wrong, but had it backwards!
> (The man page for fdisk says "try parted, then fdisk, then sfdisk"
> basically...)
> 
> Also, as you saw in Jeff's reply, there's a commands.getoutput()
> function that does basically what popen() would do, so just use whatever
> seems simplest.
> 
> -Peter



More information about the Python-list mailing list