From owner-freebsd-questions@FreeBSD.ORG Tue Aug 26 14:43:43 2003 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 4789716A4BF for ; Tue, 26 Aug 2003 14:43:43 -0700 (PDT) Received: from webserver.get-linux.org (adsl-64-161-78-226.dsl.lsan03.pacbell.net [64.161.78.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 6761943F3F for ; Tue, 26 Aug 2003 14:43:42 -0700 (PDT) (envelope-from oremanj@webserver.get-linux.org) Received: (qmail 5746 invoked by uid 1000); 26 Aug 2003 21:45:39 -0000 Date: Tue, 26 Aug 2003 14:45:39 -0700 From: Joshua Oreman To: Charles Howse Message-ID: <20030826214539.GB3912@webserver> References: <002a01c36c0c$af801500$04fea8c0@moe> <002b01c36c0f$6b55cc00$04fea8c0@moe> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002b01c36c0f$6b55cc00$04fea8c0@moe> User-Agent: Mutt/1.4.1i cc: questions@freebsd.org Subject: Re: Detect floppy diskette 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: Tue, 26 Aug 2003 21:43:43 -0000 On Tue, Aug 26, 2003 at 03:19:57PM -0500 or thereabouts, Charles Howse wrote: > > > Try this: > > #!/usr/bin/perl > > use POSIX qw/:fcntl_h dup2 setsid/; > if (fork) { exit; } > setsid; > > my $fd = POSIX::open "/dev/null", O_WRONLY or die "Can't open > /dev/null: $!\n"; > dup2 $fd, 0; > dup2 $fd, 1; > dup2 $fd, 2; > > sleep 5; > > system "sudo mount /dev/fd0 /mnt"; > > > Maybe I'm doing something wrong, all this script does is run and exit > with status 0, whether I have a diskette in the drive or not. No output > to screen or anything. Does nothing happen for 5 seconds? Good! That means you can trap the error. (Read my previous email). > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"