[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PedUnit added to parted in stable CVS.
From: |
Andrew Clausen |
Subject: |
PedUnit added to parted in stable CVS. |
Date: |
Sun, 20 Mar 2005 17:19:53 +1100 |
User-agent: |
Mutt/1.3.28i |
Hi all,
I just added include/parted/unit.h and libparted/unit.c to the stable cvs,
and made the appropriate changes to parted/ui.c and parted/parted.c.
By default, my hard disk now appears like this:
(parted) p
Disk geometry for /dev/hda: 0Kb - 20Gb
Disk label type: msdos
Number Start End Type Filesystem Flags
1 32Kb 106Mb primary fat16 boot
2 106Mb 20Gb extended lba
5 106Mb 2204Mb logical ntfs
7 2410Mb 2623Mb logical linux-swap
6 2623Mb 19Gb logical ext2
An extra command has been added:
unit UNIT set the default unit to UNIT
UNIT is one of: s, b, Kb, Mb, Gb, Tb, compact, cyl, %
For example,
(parted) unit %
(parted) print
Disk geometry for /dev/hda: 0% - 100%
Disk label type: msdos
Number Start End Type Filesystem Flags
1 0% 0% primary fat16 boot
2 0% 99% extended lba
5 0% 11% logical ntfs
7 12% 13% logical linux-swap
6 13% 99% logical ext2
Input is now accepted in all of the supported units. For example,
you can now type "mkpart primary fat16 200m 2.3gb".
Errors messages in libparted now use this API to display locations in
the default unit.
This might be rough around the edges, so please play around with it.
Also, is there still demand for a "Size" column? The new default unit
(compact) takes up less screen space, so I think we can now fit Length
in.
I would like to point out that this is not merely a cosmetic change.
The "sector" option is important for some applications where disk
locations must be described accurately. This was not previously
possible with the parted frontend to libparted. I hope this will save
lots of pain.
I hope this code has been written in a way that other frontends can
easily benefit from it. Please let me know if you think the API has any
weaknesses, or if the API documentation is difficult to understand.
Cheers,
Andrew
- PedUnit added to parted in stable CVS.,
Andrew Clausen <=