1 |
On Mon, 24 Nov 2003 17:24:11 +0000 |
2 |
Luke-Jr <luke-jr@g.o> wrote: |
3 |
|
4 |
> -----BEGIN PGP SIGNED MESSAGE----- |
5 |
> Hash: SHA1 |
6 |
> |
7 |
> I've been working on some of the partitioning code for InGen lately, |
8 |
> but I can't seem to find a *good* way to do things (such as find out |
9 |
> how much unallocated space is on a HD, etc)... |
10 |
> Does anyone have any suggestions for programming partition table |
11 |
> manipulation front ends? |
12 |
|
13 |
you could determine the number of sectors of the disk, get through the |
14 |
current partition table and fetch all first and last sectors of |
15 |
partitions, calculate the sum of each partitions sectors, substract it |
16 |
from the total number of sectors and voila: you get the unused sectors. |
17 |
|
18 |
one sector represents 512 Byte. |
19 |
|
20 |
-- Markus |
21 |
|
22 |
-- |
23 |
Markus Nigbur |
24 |
Gentoo Developer |
25 |
http://www.gentoo.org |