Re: Get drives and partitions list (Linux)

2005-06-14 Thread cantabile
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

Re: Get drives and partitions list (Linux)

2005-06-13 Thread Peter Hansen
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 back

Re: Get drives and partitions list (Linux)

2005-06-13 Thread cantabile
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 ? Peter Hansen wrote: > cantabile wrote: > >> Hi, I'd like to get drives and partitions (and their size too) with >> python under Linux. So far, I thought of read

Re: Get drives and partitions list (Linux)

2005-06-13 Thread cantabile
Hi, Jeff Great help : this works like a charm. I think I can customize it to read from sfdisk. Do you agree with Peter Hansen (post below) about fdisk ? Jeff Epler wrote: > Using /proc/partitions is probably preferable because any user can read > it, not just people who can be trusted with read a

Re: Get drives and partitions list (Linux)

2005-06-12 Thread Peter Hansen
cantabile wrote: > Hi, I'd like to get drives and partitions (and their size too) with > python under Linux. So far, I thought of reading /proc/partitions but > maybe i could use fdsik also ? > How would I do that in python ? Somebody else posted a very similar question quite recently. A Google

Re: Get drives and partitions list (Linux)

2005-06-12 Thread Jeff Epler
Using /proc/partitions is probably preferable because any user can read it, not just people who can be trusted with read access to drives, and because the format of /proc/partitions is probably simpler and more stable over time. That said, what you do is import commands fdisk_output = comm

Get drives and partitions list (Linux)

2005-06-12 Thread cantabile
Hi, I'd like to get drives and partitions (and their size too) with python under Linux. So far, I thought of reading /proc/partitions but maybe i could use fdsik also ? How would I do that in python ? Thanks for your help (newbie here :) ) -- http://mail.python.org/mailman/listinfo/python-list