Detect floppy diskette
Charles Howse
chowse at charter.net
Tue Aug 26 13:20:07 PDT 2003
> > 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.
More information about the freebsd-questions
mailing list