On Mon, 25 Sep 2000, Clayton Scott wrote:
> It:
> + stacks multiple tests quite cleanly without excess verbiage
> (if (-e && -T && -s && -x){...} gets a little tedious especially
> if you don't use $_)
> + introduces only 1 new keyword ("file" seems bad, but maybe not)
> + does not break the brains of the -X loving crowd (as much)
> + introduce long names for -X haters
> e.g. file($file, 'readable,writable,directory');
>
> Nathan Wiger wrote:
>
> >In fact, I'd much rather still a more generic function like 'want' that
> >takes a list of things to check:
> >
> > file($file); # does it exist?
> > file($file, 'r'); # is it readable?
> > file($file, 'w'); # is it writable?
> > file($file, 'd'); # is it a directory?
> > file($file, 'wd'); # is it a writable directory?
> > file($file, 'dw'); # same thing
I'd even go so far as to say that the current -X syntax should be
_extended_, to allow for multiple tests at once, maybe by way of a
leading caret (mnemonic "all"):
-^rwx; # $_ is readable, writable and executable
($size, $mod, $acc, $ichange) = -^sMAC;
And, as the filetest operators currently rely solely on the unix-ish mode
and uid/gid of the file, there should be a pragma that you can use to
force the interpretation to be "true", i.e., modulo ACLs, readonly
filesystems, etc., maybe
use filetest true;
John.