At 4:35 PM +0100 5/24/01, Brodie, R (Richard)  wrote:
>I may be wrong but Perl seems to use ACL$C_FILE in its calls to
>SYS$CHECK_ACCESS. Since devices aren't files ;) it hates it.
>I see the same results with TT: so special casing NL: may not
>be the best approach.
>
>You get sensible answers specifying ACL$C_DEVICE.

Good point.  This could also potentially bite us with mailboxes; in
fact, the null device *is* a mailbox as far as device class is
concerned:

$ write sys$output f$getdvi("nl:","devclass")
160
$ write sys$output f$getdvi("mba1:","devclass")
160
$ search SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C]DCDEF.H DC$_MAILBOX
#define DC$_MAILBOX 160                 /* MAILBOX                          */

So, my next dumb question is how do you tell the difference between a
file and a device?  Would you call lib$getdvi with DVI$_DEVCHAR and
check the DEV$V_FOD bit (indicating "Device is files oriented") to
see if it's a file, assuming all others are devices?  Or would it be
better to separate the various devclasses into the sheep and the goats?

Of course then there is the case where you want to check access on a
files-oriented device but not any particular file.  Luckily it appears
that SYS$CHECK_ACCESS does not require ACL$C_DEVICE for files-oriented
devices since this already works:

$ perl -e "print -r 'disk$alphasys:';"
1
$ perl -e "print -w 'disk$alphasys:';"
1

However, the latter does not work with a FILES-11 CD-ROM (obviously
-w would be false but so is -r).  Individual files on a CD-ROM test
out as expected though.  Sigh.

-- 
____________________________________________
Craig A. Berry                  
mailto:[EMAIL PROTECTED]

"Literary critics usually know what they're
talking about. Even if they're wrong."
        -- Perl creator Larry Wall

Reply via email to