Detecting new removable drives in Linux

Albert Hopkins marduk at python.net
Mon Mar 1 07:09:38 EST 2010


On Mon, 2010-03-01 at 10:48 +0100, Bart Smeets wrote:
> Hello,
> 
> 
> I'm trying to write a script which detects when a new removable drive
> is connected to the computer. On #python I was advised to use the
> dbus-bindings. However the documentation on this is limited. Does
> anyone know of an example of how I can detect new removable drives?

The documentation does suck and, at least for the python bindings, is
horribly outdated.

Also, the python bindings for dbus are not as "pythonic" as they could
be.  I was working on a python/dbus program a while back and basically
had to resort to looking at the source of a program that did, or almost
did, what I wanted and using that as an example.

You may even want to look at C sources as I don't think the python
bindings are that much different.

HTH,
-a






More information about the Python-list mailing list