[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [urgent] Parted 1.4.4
From: |
Andrew Clausen |
Subject: |
Re: [urgent] Parted 1.4.4 |
Date: |
Thu, 30 Nov 2000 15:18:40 +1100 |
Matt Wilson wrote:
>
> On Thu, Nov 30, 2000 at 03:02:16PM +1100, Andrew Clausen wrote:
> >
> > BTW, I don't like receiving patches, without hearing about them
> > beforehand. If there are any changes, other than adding new
> > files (i.e. internal changes to libparted), then these should
> > be discussed on the list. In fact, I think it's best if the
> > entire development/design is discussed on the list.
>
> This will be the rewritten-for-1.4.x ia64 efi gpt partitioning scheme
> support that we've talked about already (but not on list, I think).
> It's only new files - no internal changes so far.
Good :-)
What happened with the add_partition() and remove_partition()
methods of PedDisk? Are they no longer needed?
Basically: I need to do this "diff" thing, anyway (with the blkpg
interface. See the ioctl()'s in <linux/blkpg.h> in 2.4)
It looks similar... should there be generic support for this?
Is there anything that needs to be "diffed", other than the
partition numbers, partition start and partition end?
> My python module is also only new files (so far - I've not found
> anything impossible to do without a internals change). So far I have
> (for example):
>
> import parted
>
> def exception_handler(exception):
> print "%s: %s" % (exception.type_string, exception.message)
> return parted.EXCEPTION_UNHANDLED
>
> parted.exception_set_handler (exception_handler)
>
> path = '/dev/hda'
> dev = parted.device_get (path)
> disk = parted.disk_open (dev)
>
> print "%s: length %ld" % (path, dev.length)
>
> part = disk.next_partition()
> if part:
> print "Device Type Start End Length"
> while part:
> if (part.type == parted.PARTITION_PRIMARY
> or part.type == parted.PARTITION_EXTENDED
> or part.type == parted.PARTITION_LOGICAL):
> print ("%s%d %-12s %-10ld %-10ld %-10ld"
> % (path, part.num, part.type_name, part.geom.start,
> part.geom.end, part.geom.length))
> part = disk.next_partition(part)
>
> Example of the output:
> address@hidden python]# ./test.py
> /dev/hda: length 19999728
> Device Type Start End Length
> /dev/hda1 primary 63 4096574 4096512
> /dev/hda2 extended 4096575 19984859 15888285
> /dev/hda5 logical 4096638 4369679 273042
> /dev/hda6 logical 4369743 19984859 15615117
>
> This doesn't show all of the functionality yet, I'd say I'm about 35%
> done with the binding.
Excellent! Looks lovely :-)
Thanks a lot :-)
Andrew Clausen