[
https://issues.apache.org/jira/browse/HADOOP-7209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239499#comment-13239499
]
Daryn Sharp commented on HADOOP-7209:
-------------------------------------
bq. The existing output directory will be removed. But in case of the directory
does not exist, rmdir --ignore-fail-on-non-empty silently ignore and continue
with the MR job.
No, that is not how the flag works on linux. The flag only ignores a failed
delete on an existing directory that contains items.
{noformat}
$ ls -d non-existent-dir
ls: non-existent-dir: No such file or directory
$ rmdir --ignore-fail-on-non-empty non-existent-dir; echo exit=$?
rmdir: non-existent-dir: No such file or directory
exit=1
{noformat}
Rm's -f flag does what you want. It will not return an error if the directory
does not exist.
> Extensions to FsShell
> ---------------------
>
> Key: HADOOP-7209
> URL: https://issues.apache.org/jira/browse/HADOOP-7209
> Project: Hadoop Common
> Issue Type: Improvement
> Affects Versions: 0.20.3
> Reporter: Olga Natkovich
> Assignee: Daryn Sharp
> Fix For: 0.24.0
>
>
> Our project, Pig, exposes FsShell functionality to our end users through a
> shell command. We want to use this command with no modifications to make sure
> that whether you work with HDFS through Hadoop or Pig you get identical
> semantics.
> The main concern that has been recently raised by our users is that there is
> no way to ignore certain failures that they consider to be benign, for
> instance, removing a non-existent directory.
> We have 2 asks related to this issue:
> (1) Meaningful error code returned from FsShell (we use java class) so that
> we can take different actions on different errors
> (2) Unix like ways to tell the command to ignore certain behavior. Here are
> the commands that we would like to be expanded/implemented:
> * rm -f
> * rmdir ---ignore-fail-on-non-empty
> * mkdir -p
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira