Peter Miller wrote:
> Dear Lazy Web,
> 
> I know Nautilus can figure it out, but that's a big code base, and while
> I'm reading, I thought I'd ask you guys, too.
> 
> Does anyone know what ioctl() or ioctl()s does Nautilus use to tell the
> kind of blank media is in the CD-Rom drive?

Perhaps naïvely, I'd expect Nautilus would ask HAL rather than do the
ioctl()ing itself.  A quick bit of searching with codesearch.google.com
suggests I might be right:

<http://www.google.com/codesearch/p?hl=en#WUhbbSwuY44/nautilus-cd-burner-2.17.2/src/nautilus-burn-drive-monitor.c&q=package:nautilus-cd-burner%20%22volume.disc.capacity%22>

Relevant snippet of src/nautilus-burn-drive-monitor.c of nautilus-cd-burner
2.17.2:

        size = libhal_device_get_property_uint64 (monitor->priv->ctx,
                                                  drive->priv->media_udi,
                                                  "volume.disc.capacity",
                                                  &error);

In hal, it looks like hald/linux/probing/linux_dvd_rw_utils.c's
get_disc_capacity_for_type is where volume.disc.capacity is set (on Linux
anyway)... apparently via issuing SCSI commands via ioctls!  Codesearch
link:

<http://www.google.com/codesearch/p?hl=en#CJAAg7rNO1A/hal-0.5.9/hald/linux/probing/linux_dvd_rw_utils.c&q=package:hal%20function:get_disc_capacity_for_type>

-Andrew.

_______________________________________________
coders mailing list
coders@slug.org.au
http://lists.slug.org.au/listinfo/coders

Reply via email to