From owner-freebsd-newbies Mon Jan 13 15:48:35 2003 Delivered-To: freebsd-newbies@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9155237B401 for ; Mon, 13 Jan 2003 15:48:34 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4584543EB2 for ; Mon, 13 Jan 2003 15:48:32 -0800 (PST) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a230.otenet.gr [212.205.215.230]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id h0DNmKb1017070; Tue, 14 Jan 2003 01:48:22 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.6/8.12.6) with ESMTP id h0DNmKQH004112; Tue, 14 Jan 2003 01:48:20 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.6/8.12.6/Submit) id h0DNmJvc004108; Tue, 14 Jan 2003 01:48:19 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 14 Jan 2003 01:48:19 +0200 From: Giorgos Keramidas To: Fox Cc: freebsd-newbies@FreeBSD.org Subject: Re: detecting open cd drive Message-ID: <20030113234819.GA3695@gothmog.gr> References: <20030110031616.359a7dcc.one-@madridwireless.net> <5.0.2.1.0.20030113091738.02802130@pop-server.austin.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.0.2.1.0.20030113091738.02802130@pop-server.austin.rr.com> Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 2003-01-13 09:20, foxbsd@gristle.to (Fox) wrote: > Is there a way to detect that the cdrom drive has been closed from > userland. I want to launch a script triggered by the cdrom drive > tray closing. > > I am using FreeBSD 4.7 You could probably poll using ioctl(fd, CDIOREADTOCHEADER, ...) but this is something I haven't tested :-/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message