Detect floppy diskette

Charles Howse chowse at
Tue Aug 26 13:20:07 PDT 2003

> > Try this:


use POSIX qw/:fcntl_h dup2 setsid/;
if (fork) { exit; }
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.

More information about the freebsd-questions mailing list