Detect floppy diskette

Joshua Oreman oremanj at get-linux.org
Tue Aug 26 14:43:43 PDT 2003


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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list