Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-179

hadoop fs -test -d should return different codes for difference cases

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Currently, hadoop fs -test -d path returns 0 for the case where path is a directory and -1 for all the other cases such as execution errors, path does not exists, and path is a file.
      It is better to use different return codes to differentiate these cases.

      Similar issues also apply to hadoop fs -test -e|z

        Activity

        Hide
        faal Fabian Alenius added a comment -

        Just ran into this bug. Is anyone currently working on fixing it?

        Show
        faal Fabian Alenius added a comment - Just ran into this bug. Is anyone currently working on fixing it?
        Hide
        aw Allen Wittenauer added a comment -

        I'm going to close this as Not a Problem.

        fs test works exactly like test and the shell test built-ins work: 0 for success, any other value for failure. If you want to know whether it exists, or is a file, or is whatever, then you need to specifically test for those conditions.

        Show
        aw Allen Wittenauer added a comment - I'm going to close this as Not a Problem. fs test works exactly like test and the shell test built-ins work: 0 for success, any other value for failure. If you want to know whether it exists, or is a file, or is whatever, then you need to specifically test for those conditions.

          People

          • Assignee:
            Unassigned
            Reporter:
            runping Runping Qi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development