I'm writing a utility for which I need to detect whether a floppy disk is present in the floppy disk drive, even when it is broken (cannot be read due to I/O errors).
How can I do this? [ -r /dev/fd0 ]
always succeeds, even when no floppy is present; something like dd if=/dev/fd0
will fail when the floppy is broken.