ACCESS(2) sometimes NOT useful - (nf)
Dave Borman
borman at decvax.UUCP
Mon Sep 26 23:42:54 AEST 1983
Access(2) and open(2) should give you all you need. Almost all calls to
access that I have seen are followed by an open. You check the permission
by ruid with access, and then open the file. If you want to check permission
via euid, then just open the file! If you can't access it, the open will
fail. If you don't want the file open, you can always close it. If you
want the permission bits, there is always stat(2) which will give you
everything you ever wanted to know about a file. There is no sense adding
a new syscall eaccess(), but if you really want it the function eaccess
can be written by using open and stat. (Plus it'll be much more portable)
-Dave Borman,
decvax!borman (formerly stolaf!borman)
More information about the Comp.unix.wizards
mailing list