Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13522

Add %A and %a formats for fs -stat command to print permissions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha1
    • 2.9.0, 3.0.0-alpha2
    • fs
    • None
    • Reviewed
    • Added permissions to the fs stat command. They are now available as symbolic (%A) and octal (%a) formats, which are in line with Linux.

    Description

      This patch adds to fs/shell/Stat.java the missing options of %a and %A.

      FileStatus already contains the getPermission() method required for returning symbolic permissions. FsPermission contains the method to return the binary short, but nothing to present in standard Octal format.

      Most UNIX admins base their work on such standard octal permissions. Hence, this patch also introduces one tiny method to translate the toShort() return into octal.

      Build has already passed unit tests and javadoc.

      Attachments

        1. HADOOP-13522.008.patch
          7 kB
          Alex Garbarini
        2. HADOOP-13522.007.patch
          7 kB
          Alex Garbarini
        3. HADOOP-13522.006.patch
          6 kB
          Alex Garbarini
        4. HADOOP-13522.005.patch
          15 kB
          Alex Garbarini
        5. HADOOP-13522.004.patch
          5 kB
          Alex Garbarini
        6. HADOOP-13522.003.patch
          4 kB
          Alex Garbarini
        7. HADOOP-13522.002.patch
          4 kB
          Alex Garbarini
        8. HADOOP-13522.001.patch
          4 kB
          Alex Garbarini

        Issue Links

          Activity

            People

              algarbar Alex Garbarini
              algarbar Alex Garbarini
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: