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

Andras Bokor commented on HADOOP-9474:
--------------------------------------

I don't think it is an issue. This behavior is in sync with Unix way. Your 
cannot copy files to a non-existing directory but you can copy a directory to 
another path:
{code}$ cp mydir/* fakedir
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... 
target_directory
$ cp mydir/* existingdir
$ ls existingdir/
1       2
$ cp -r mydir/ fakedir; ls fakedir
1       2{code}


> fs -put command doesn't work if selecting certain files from a local folder
> ---------------------------------------------------------------------------
>
>                 Key: HADOOP-9474
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9474
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 1.1.2
>            Reporter: Glen Mazza
>
> The following four commands (a) - (d) were run sequentially.  From (a) - (c) 
> HDFS folder "inputABC" does not yet exist.
> (a) and (b) are improperly refusing to put the files from conf/*.xml into 
> inputABC because folder inputABC doesn't yet exist.  However, in (c) when I 
> make the same request except with just "conf" (and not "conf/*.xml") HDFS 
> will correctly create inputABC and copy the folders over.  We see that 
> inputABC now exists in (d) when I subsequently try to copy the conf/*.xml 
> folders, it correctly complains that the files already exist there.
> IOW, I can put "conf" into a nonexisting HDFS folder and fs will create the 
> folder for me, but I can't do the same with "conf/*.xml" -- but the latter 
> should work equally as well.  The problem appears to be in 
> org.apache.hadoop.fs.FileUtil, line 176, which properly routes "conf" to have 
> its files copied but will have "conf/*.xml" subsequently return a 
> "nonexisting folder" error.
> {noformat}
> a) gmazza@gmazza-work:/media/work1/hadoop-1.1.2$ bin/hadoop fs -put 
> conf/*.xml inputABC
> put: `inputABC': specified destination directory doest not exist
> b) gmazza@gmazza-work:/media/work1/hadoop-1.1.2$ bin/hadoop fs -put 
> conf/*.xml inputABC
> put: `inputABC': specified destination directory doest not exist
> c) gmazza@gmazza-work:/media/work1/hadoop-1.1.2$ bin/hadoop fs -put conf 
> inputABC
> d) gmazza@gmazza-work:/media/work1/hadoop-1.1.2$ bin/hadoop fs -put 
> conf/*.xml inputABC
> put: Target inputABC/capacity-scheduler.xml already exists
> Target inputABC/core-site.xml already exists
> Target inputABC/fair-scheduler.xml already exists
> Target inputABC/hadoop-policy.xml already exists
> Target inputABC/hdfs-site.xml already exists
> Target inputABC/mapred-queue-acls.xml already exists
> Target inputABC/mapred-site.xml already exists
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to