HAL depreciated, but what replaced it?

Richard Shaw hobbes1069 at gmail.com
Thu Oct 13 14:13:00 UTC 2011


On Wed, Oct 12, 2011 at 8:16 PM, Dan Williams <dcbw at redhat.com> wrote:
> udev replaced HAL, along with some additional helpers.  udev has a
> database too, much like HAL.  You can use libudev or libgudev (if you
> use glib) to talk to udev and get information.

Ok, I found python-gudev which lets me talk to udev!

And I thought the documentation on UDisks was poor. The only
documentation in the package is a README file with a bad link and a
test program.


>> I've worked around that for testing the property
>> "DriveMediaCompatibility" > 0 since it returns an array but this would
>> also pick up flash card readers, zip, and jaz drives. I'll have to
>> modify that to look for "optical" on the front of any members of the
>> array.
>>
>> Second, I can not find any property that reports the disc capacity.
>> The only property that looked close is "DriveSize" but for a blank
>> disc this reports the same as the SectorSize, 2048.
>
> UDISKS_PARTITION_SIZE

I'm thinking the equivalent in the python wrapper is "PartitionSize".
The problem is that it AND "DeviceSize" both report 2048...

Right now I'm using the test program provided with python-gudev and I
think I'm making headway. It has a property "ID_TYPE" that is "cd" for
optical drives so that's one problem down. Now I just have to figure
out how to:

1. Get the drive capacity.
2. Get the media state.
3. Detect and properly handle media changes.

Thanks,
Richard

Thanks,
Richard


More information about the devel mailing list