Hi,

I have written some code that does some rather nasty stuff to determine
whether or not there is media in the drive.  It is basically this:

open('/dev/dvd', 'rb')
read(1)

  at which point if I get an exception (in Python) I know there is no
media (or it is blank).  If it throws no exception I consider the disc
to be good.

  I know how bad this is (I unfortunately don't understand ioctls and
need this to work quickly in the short term -- I plan on learning more
about this stuff and doing it properly later) but my question is this:

Does the device actually get read /every/ time I do this operation?  (it
gets called every two seconds)  It looks to me that after an initial
probe there are no further accesses, which makes me wonder if further
down some caching is done.  Anybody know what is really going on?

  Thanks,

-lewiz.

-- 
I was so much older then, I'm younger than that now.  --Bob Dylan, 1964.
------------------------------------------------------------------------
-| msn:[EMAIL PROTECTED] | jabber:[EMAIL PROTECTED] | url:www.lewiz.org |-

Attachment: pgpLxndnLePRY.pgp
Description: PGP signature

Reply via email to