develooper Front page | perl.perl5.porters | Postings from April 2000

'-X' vs. 'POSIX::access' on AFS ...

Thread Next
April 19, 2000 19:38
'-X' vs. 'POSIX::access' on AFS ...
Message ID:

According to the documentation, the file test operators ('-X') use the
user's uid and gid and the 'stat' function to determine its results.

There exists a POSIX function called 'access' that somehow also determines
file information.

It seems that under AFS (or at least the AFS I have to work with) they
return different results. A file might be unreadable ('-r' returns
false) while a call to 'access' might determine the file is readable
(returns true). Also most programs and shells act as if they are using
'access' (in fact Perl seems to be the only tool complaining).

Can anyone explain the internals of both '-X' and the system call
'access'? The man page for 'access' is short on implementation details
and I have been unable to find much on the Web.

The '-X' operators provide more information (such as "Is a file a text
file?") while the 'access' call can only check if a file is readable, 
writeable, executable, or just exists, so I can see the need for '-X'.

But in this case '-X' is not recognizing (it seems) that AFS exists and
that access might be allowed even if the user is not part of the file's
group and group/world permissions are 000.

Any and all pointers to documentation are welcome! I apologize if this is
an old topic for the group.

Thank you for your time,

  Quentin Crain

I think we are miscommunicating. I actually expected some confusion with
my last response and I am not sure if there actually was some, but I feel
like it. So, my message is going to assume I did not make my points, but
perhaps you did understand me. If so, then that means *I* did not
understand *YOUR* response - in which case you will need to rephrase.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About