Detect SD card absence to give warning

I would like to detect whether an SD card is mounted or not when the camera is running and not connected to the IDE (to be able to give a warning with the LEDs if it isn’t - that part I can do).

I tried to list the current working directory and similar approaches with the uos library but it always displays the same, irrespective of whether an SD card is mounted or not.

How can I do that?

See:

Excellent, thanks!