[ 
https://issues.apache.org/jira/browse/HADOOP-10579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18085748#comment-18085748
 ] 

ASF GitHub Bot commented on HADOOP-10579:
-----------------------------------------

LamiumAmplexicaule commented on code in PR #8259:
URL: https://github.com/apache/hadoop/pull/8259#discussion_r3347323630


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/find/Perm.java:
##########
@@ -0,0 +1,209 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.fs.shell.find;
+
+import java.io.IOException;
+import java.util.Deque;
+
+import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.hadoop.fs.shell.PathData;
+
+/**
+ * Implements the -perm expression for the {@link 
org.apache.hadoop.fs.shell.find.Find} command.
+ */
+final class Perm extends BaseExpression {
+  /**
+   * Registers this expression with the specified factory.
+   */
+  public static void registerExpression(ExpressionFactory factory) throws 
IOException {
+    factory.addClass(Perm.class, "-perm");
+  }
+
+  private static final String[] USAGE = {"-perm [-]mode", "-perm [-]onum"};
+  private static final String[] HELP = {"Evaluates as true if the file 
permissions match that",
+      "specified. If the hyphen is specified then the expression",
+      "shall evaluate as true if at least the bits specified",
+      "match, otherwise an exact match is required.",
+      "The mode may be specified using either symbolic notation,",
+      "eg 'u=rwx,g+x+w' or as an octal number."};

Review Comment:
   It wasn’t implemented in a way that would pass, so I fixed the parsing part 
to allow `g+x+w` in 
https://github.com/apache/hadoop/pull/8259/changes/9d86bfe39a675a48152ba2249f12723578d56506.





> Find command - add match expressions to find command
> ----------------------------------------------------
>
>                 Key: HADOOP-10579
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10579
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Jonathan Allen
>            Assignee: Hiroki Egawa
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: HADOOP-10579.patch
>
>
> Add match expressions to the find command created under HADOOP-8989, e.g.:
> - atime
> - empty
> - group
> - mtime
> - newer
> - nogroup
> - nouser
> - perm
> - regex
> - size
> - user



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to