<div>Hello,</div><div><br></div>sorry, I didn't realize this: I thought a nopaste link with highlighting would be easier to examine. This is my code, and I hope the comments I added are clear enough for you to understand my issue.<br>
<br>/* NOTE: the filesystem is resized before the partition if the size is decreasing; the filesystem is resized after the partition if the size is increased */<br>void ResizeHelper::resizePartition(const QString& diskName, const QString& partitionName, qulonglong size) /* the new size here is in bytes */<br>
{<br> int partitionNum = partitionName.right(1).toInt(); /* this gets the partition number, like 4 for /dev/sda4 */<br> long long int sectorSize = size / 512; /* for now I use a constant, which is good for the disk I'm testing this code on, but I'm going to compute the actual value here */<br>
<br> ped_device_probe_all();<br> <br> PedDevice* device = ped_device_get( diskName.toUtf8().data() );<br> PedDisk* disk = ped_disk_new(device);<br> PedPartition* partition = ped_disk_get_partition(disk, partitionNum);<br>
PedGeometry geometry = partition->geom;<br> <br> PedGeometry* newGeometry = ped_geometry_new(device, geometry.start, sectorSize);<br> PedConstraint* constraint = ped_constraint_exact(newGeometry);<br> <br>
if (ped_disk_set_partition_geom(disk, partition, constraint, newGeometry->start, newGeometry->start + newGeometry->length - 1) == 0) {<br> qDebug() << "error"; /* this isn't displayed */<br>
}<br><br> /* calls to _destroy functions here */<br>}<div><br></div><div>Lisa<br><br><br>2012/8/28 Håkon Løvdal <<a href="mailto:hlovdal@gmail.com">hlovdal@gmail.com</a>><br>><br>> Imagine that say 2 years from now, some person wants to study an open<br>
> source/free<br>> software project and selects parted. Archives of the mailing list will<br>> now be in an<br>> incomplete state because parts of it was "outsourced" to places no<br>> longer existing.<br>
> This is not good, so please post all details directly to the mailing list.<br>><br>> BR Håkon Løvdal<br>><br>> PS<br>> In addition, by posting a link you are setting a higher barrier for people to<br>> answer you, so it is also in your direct interest to post to the list.<br>
<br>--<br>They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.</div>