Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HDFS >> mail # user >> Can we use method CopyToLocalFile() to copy HDFS files to windowsXP?


+
wisteria_longyan 2010-12-02, 00:56
+
Jeff Zhang 2010-12-02, 01:26
+
Siqin.Chen 2010-12-02, 01:39
+
hdfs-user-return-684-wist...@... 2010-12-03, 01:03
Copy link to this message
-
Re: Can we use method CopyToLocalFile() to copy HDFS files to windowsXP?
Because the HDFS's ACL is different from your local file system.

The file's owner on HDFS may be user A, and user B copy it to local,
but do not have permission on this file, so after you download the
file to local,you need to change this file's permission, actually
hadoop did this for you by invoking shell command "chmod"

You can refer setPermission(Path p, FsPermission permission) in
RawLocalFileSystem for more details.
On Fri, Dec 3, 2010 at 9:03 AM,
<[EMAIL PROTECTED]>
wrote:
> Hi Jeff,
>
> Yeah, you're quite right. I've tried it and it works well with $CYGWIN_HOME/bin on windows' PATH.
>
> But I'm still a bit confused on the reason. Why should chmod be invoked from $CYGWIN_HOME/bin and which mode was changed by it?
>
>
> Much appreciated,
> siqin^^;;
>
>
> -----邮件原件-----
> 发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 代表 Jeff Zhang
> 发送时间: 2010年12月2日 9:26
> 收件人: [EMAIL PROTECTED]
> 主题: Re: Can we use method CopyToLocalFile() to copy HDFS files to windowsXP?
>
> You need to install cygwin, and put $CYGWIN_HOME/bin on your path
>
>
>
> 2010/12/2 wisteria_longyan <[EMAIL PROTECTED]>:
>> Hi,
>>
>>
>>
>> We encountered a trouble these days that we cannot copy HDFS files to
>> windowsXP using method CopyToLocalFile(). The copying process is interrupted
>> by the exception below:
>>
>>
>>
>> Exception in thread "main" java.io.IOException: Cannot run program "chmod":
>> CreateProcess error=2, ?????????
>>
>>
>>
>> I’ve no idea why this happened for the copying process using
>> CopyFromLocalFile() which can successfully put files under some windowsXP
>> folder unto HDFS without any errors.
>>
>>
>>
>> Both copying are with the help of Eclipse having the Hadoop plug-in
>> installed.
>>
>>
>>
>> Could it be that the program is trying to find command chmod on windowsXP
>> when using CopyToLocalFile() from HDFS to windows? If so, I think it would
>> fail in no doubts and can explain why there’s no erros during
>> CopyFromLocalFile() from windows to HDFS. But, if this is the truth, then
>> how can I copy HDFS files to windows OS?
>>
>>
>>
>> Thanks very much in advance. J
>>
>>
>>
>> Best regards,
>>
>> Siqin Chen (陈思勤)
>>
>> One is never too old to learn. ^^
>>
>>
>>
>> ________________________________
>> 网易163/126邮箱百分百兼容iphone ipad邮件收发
>
>
>
> --
> Best Regards
>
> Jeff Zhang
>
>
>
>

--
Best Regards

Jeff Zhang
+
Siqin.Chen 2010-12-03, 05:25