access(2) is out, as it uses the real uid and real gid, not the effective
uid and gid. As Scott noted, it is intended for setuid programs.
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.
This is correct. Scsh assumes Unix. AFS doesn't respect Unix file protection
semantics. That's a problem.
The only real fix would be to make the file-readable? etc. calls AFS-aware.
That's pretty system-specific. And it *still* wouldn't handle the code that
explicitly used stat(2) (i.e., file-attributes). There's just a basic Unix/AFS
mismatch. However, if someone did AFS-aware versions of the higher-level
procedures, then you could code in a way that would be portable across the two
different file systems. Unfortunately, I don't have AFS on my system, so I
can't do this.