On a CentOS6 system I have /dev/block/sr0 (read only) and /dev/block/sda (read/write). How can I find out programmatically which devices are read-only? There is a ro file in there, but it's '0' for both devices.
There are some hacks I could use (compare names ^sr vs ^sd, look for cdrom ownership of device node), but I'd like to have a generic solution.
