M0E Lnx ha scritto:
Well, it took half an hour to install libparted and write some code. No documentation about this lib: ldap was well documented instead.Huh!.I wouldn't be surprised at all if your arguments are true, but for someone like myself, I feel that the documentation on this subject very limited. I will try to look at some examples. I need to access the libparted library, in the mean time, if you want to work up a sample for me that accesses the library, that would be swell! ;)
I attach a sample project which calls just three libparted functions; I had to consult the include files.
It is not so simple, but hey! You want to fiddle with not-so-easy things...The big problem is with strings - I don't know why gambas strings don't map exactly to char* in C, but there must be good reasons (well I readed something about, but can remember well). You can pass gambas string straightforward to C char*, but you can't do the inverse.
Anyway, in the attached project you can see two or three useful things: how to declare external calls, how to read C strings, and how to cope with pointers to structures. I suspect the structure must be freed, but I didn't have the lust to read all the .h about parted... :-)
The project simply tries to open /dev/hda, hdb, hdc and hdd. Perhaps you have these newer SATA disks... if so, you have to change the source.
Have fun; if I can help I will try - but I don't want to read all that libparted documentation (well, *no* docs, only C include files...)
Regards, -- Doriano Blengino "Listen twice before you speak. This is why we have two ears, but only one mouth."
Parted-0.0.1.tar.gz
Description: application/tgz
------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com
_______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user