I believe that the current implementation of file-readable? could be more
reliable. It assumes UFS semantics: it stats the file, then manually (?)
checks the permission bits.
For example, we use AFS. Read access is controlled by 1 permission bit and
Access Control Lists. There could be similar problems with NFS.
I'm inclined to think that access(2) is a better way to do this kind of
checks. Sure, it's not reliable for root access (*); but at least, scsh
would answer what the system says: mine checks ACLs, so it'd be OK for AFS.
BTW, is there any hope to see scsh available on Dec alphas ?
(*): on my SunOS, access() says OK to root on a -rwx------ root-owned
NFS-mounted file, but root can't cat it. BTW, guess what ?
$ cat bookbrowser
cat: write error: Permission denied
Unix, I love you.
In fact, access() seems to do the same checks than open(). In the previous
case, only read() will refuse with Permission denied. So to be sure, one has
to read at least one char; this only works for files, and I don't see how it
could be extended to file-writable?... NFS brain-damage.