Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decvax.UUCP Path: utzoo!linus!decvax!borman From: borman@decvax.UUCP (Dave Borman) Newsgroups: net.unix-wizards Subject: Re: ACCESS(2) sometimes NOT useful - (nf) Message-ID: <219@decvax.UUCP> Date: Mon, 26-Sep-83 09:42:54 EDT Article-I.D.: decvax.219 Posted: Mon Sep 26 09:42:54 1983 Date-Received: Tue, 27-Sep-83 03:07:43 EDT References: <2951@uiucdcs.UUCP> Organization: DEC UNIX Engineering Group, Merrimack, NH Lines: 12 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)