HAL depreciated, but what replaced it?
dcbw at redhat.com
Fri Oct 14 14:58:41 UTC 2011
On Thu, 2011-10-13 at 09:13 -0500, Richard Shaw wrote:
> 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.
Well, a google search for "udisks documentation" brings up:
which pretty much describes the udisks D-Bus interface for udisks 1.x,
which is what ships in Fedora 15 at least.
> >> 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.
More information about the devel