Subject: Re: sun-lamp CVS commits
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 10/04/1995 16:20:10
> I think, if you want to test the presence of a device, you should try
> to open it for reading.  If you succeed, the device is present.

Yes...but if you fail, that does not necessarily mean the device is
absent.  It could mean it isn't powered on, it could mean it has no
media in it, it could mean anything the driver wants it to mean.

> Unfortunately you're right, this is not really possible to do with
> sh.

It's not?

On a NetBSD/sparc machine with a bwtw0 but only one disk (sd0),

[Callisto] 15> sh -c 'if ( < /dev/sd2a ) 2> /dev/null; then echo yes; else echo no; fi'
no
[Callisto] 16> sh -c 'if ( < /dev/bwtwo0 ) 2> /dev/null; then echo yes; else echo no; fi'
yes
[Callisto] 17>

Looks like just what the doctor ordered.

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu