From owner-freebsd-questions@FreeBSD.ORG Mon Jun 21 19:42:04 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE12716A4CE for ; Mon, 21 Jun 2004 19:42:04 +0000 (GMT) Received: from infidel.fajita.org (oldhallfarm.demon.co.uk [80.176.128.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36C1C43D5A for ; Mon, 21 Jun 2004 19:42:02 +0000 (GMT) (envelope-from lewiz@fajita.org) Received: from majic.fajita.org (majic.fajita.org [192.168.0.4]) by infidel.fajita.org (8.12.10/8.12.10) with ESMTP id i5LJfrY5003251 for ; Mon, 21 Jun 2004 20:41:53 +0100 (BST) (envelope-from lewiz@fajita.org) Received: (from lewiz@localhost) by majic.fajita.org (8.12.10/8.12.10/Submit) id i5LJfrb2003250 for questions@freebsd.org; Mon, 21 Jun 2004 20:41:53 +0100 (BST) (envelope-from lewiz) Date: Mon, 21 Jun 2004 20:41:53 +0100 From: Lewis Thompson To: FreeBSD-questions Message-ID: <20040621194153.GB2342@fajita.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FkmkrVfFsRoUs1wW" Content-Disposition: inline X-GPG-Fingerprint: 90A4 939E 3847 A3E4 8103 2A48 22DA B428 542F ED3F X-GPG-Info: http://www.lewiz.org/~lewiz/pgpkey / horowitz.surfnet.nl User-Agent: Mutt/1.5.6i X-MailScanner-Information: Please contact the ISP for more information X-MailScanner: Found to be clean X-MailScanner-From: lewiz@fajita.org Subject: Repeated polling of CD/DVD-ROM. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2004 19:42:04 -0000 --FkmkrVfFsRoUs1wW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. --=20 I was so much older then, I'm younger than that now. --Bob Dylan, 1964. ------------------------------------------------------------------------ -| msn:purple@lewiz.net | jabber:lewiz@jabber.org | url:www.lewiz.org |- --FkmkrVfFsRoUs1wW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA1zoBItq0KFQv7T8RAqkDAKDtiP6r8EYaYUoDDjk+rTk+dlj1FACg4G3K pa4v3Ddaq7MCJ8B75HkJva0= =FaK+ -----END PGP SIGNATURE----- --FkmkrVfFsRoUs1wW--