Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 80067 invoked from network); 9 Sep 2008 23:06:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2008 23:06:37 -0000 Received: (qmail 82769 invoked by uid 500); 9 Sep 2008 23:06:32 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 82745 invoked by uid 500); 9 Sep 2008 23:06:32 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 82730 invoked by uid 99); 9 Sep 2008 23:06:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 16:06:32 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 23:05:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8B124234C1D4 for ; Tue, 9 Sep 2008 16:05:44 -0700 (PDT) Message-ID: <342072775.1221001544568.JavaMail.jira@brutus> Date: Tue, 9 Sep 2008 16:05:44 -0700 (PDT) From: "Owen O'Malley (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Commented: (HADOOP-4108) FileSystem support for POSIX access method In-Reply-To: <37364288.1220846564500.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-4108?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D126= 29649#action_12629649 ]=20 Owen O'Malley commented on HADOOP-4108: --------------------------------------- Ok, that is a very different patch. If you just want to create a utility fu= nction in FileUtil that looks like: {code} boolean access(Path path, FsAction perm) throws IOException; {code} It might makes sense, but it is probably a one liner. I'm still -1 to imple= menting the jira as spec'ed. > FileSystem support for POSIX access method > ------------------------------------------ > > Key: HADOOP-4108 > URL: https://issues.apache.org/jira/browse/HADOOP-4108 > Project: Hadoop Core > Issue Type: New Feature > Components: fs > Reporter: Pete Wyckoff > > From man access: > {code} > int access(const char *pathname, int mode); > {code} > DESCRIPTION > access checks whether the process would be allowed to read, wri= te or test for existence of the file (or other file system object) whose na= me is pathname. If pathname is a symbolic link permissions of the file ref= erred to by this symbolic link are tested. > mode is a mask consisting of one or more of R_OK, W_OK, X_OK and F= _OK. > R_OK, W_OK and X_OK request checking whether the file exists and h= as read, write and execute permissions, respectively. F_OK just requests c= hecking for the existence of the file. > The tests depend on the permissions of the directories occurring i= n the path to the file, as given in pathname, and on the permissions of dir= ectories and files referred to by symbolic links encountered on the way. > The check is done with the process=C3=A2s real uid and gid, rather= than with the effective ids as is done when actually attempting an operati= on. This is to allow set-UID programs to > easily determine the invoking user=C3=A2s authority. > Only access bits are checked, not the file type or contents. T= herefore, if a directory is found to be "writable," it probably means that = files can be created in the directory, > and not that the directory can be written as a file. Similarly, a= DOS file may be found to be "executable," but the execve(2) call will stil= l fail. > If the process has appropriate privileges, an implementation may i= ndicate success for X_OK even if none of the execute file permission bits a= re set. > RETURN VALUE > On success (all requested permissions granted), zero is returned. = On error (at least one bit in mode asked for a permission that is denied, = or some other error occurred), -1 is > returned, and errno is set appropriately. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.