hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Zhang <zjf...@gmail.com>
Subject Re: Can we use method CopyToLocalFile() to copy HDFS files to windowsXP?
Date Fri, 03 Dec 2010 01:40:43 GMT
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,
<hdfs-user-return-684-wisteria_longyan=126.com@hadoop.apache.org>
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^^;;
>
>
> -----邮件原件-----
> 发件人: hdfs-user-return-683-wisteria_longyan=126.com@hadoop.apache.org [mailto:hdfs-user-return-683-wisteria_longyan=126.com@hadoop.apache.org]
代表 Jeff Zhang
> 发送时间: 2010年12月2日 9:26
> 收件人: hdfs-user@hadoop.apache.org
> 主题: 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 <wisteria_longyan@126.com>:
>> 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

Mime
View raw message