hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Douglas (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HADOOP-3331) Return code for "hadoop dfs -test" does not match standard return codes from System.exit
Date Fri, 07 Nov 2008 20:09:44 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-3331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Chris Douglas resolved HADOOP-3331.
-----------------------------------

    Resolution: Duplicate

Duplicate of HADOOP-3792

> Return code for "hadoop dfs -test" does not match standard return codes from System.exit
> ----------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3331
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3331
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: fs
>         Environment: All
>            Reporter: Mike Dillon
>            Priority: Minor
>
> The output of "hadoop dfs -test" does the opposite of what normal Unix commands to (which
is also the opposite of the recommended return codes in the javadocs for System.exit). Normal
commands return zero for success and non-zero for error, but "hadoop dfs -test" does this
opposite. This makes writing shell scripts that use "hadoop dfs -test" clunky and unnatural
since you can't do standard stuff like this:
> {noformat}
> if hadoop dfs -test -e /missing/file/name; then
>     # Do something only if the file exists
> else
>     # Do something else if the file is missing
> fi
> {noformat}
> Creating a patch for this would introduce a breaking change and would require changing
the Ant DFS task as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message