Date: Tue, 26 Aug 2003 14:45:39 -0700 From: Joshua Oreman <oremanj@get-linux.org> To: Charles Howse <chowse@charter.net> Cc: questions@freebsd.org Subject: Re: Detect floppy diskette Message-ID: <20030826214539.GB3912@webserver> In-Reply-To: <002b01c36c0f$6b55cc00$04fea8c0@moe> References: <002a01c36c0c$af801500$04fea8c0@moe> <002b01c36c0f$6b55cc00$04fea8c0@moe>
next in thread | previous in thread | raw e-mail | index | archive | help
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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030826214539.GB3912>