Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7A9EC11C13 for ; Wed, 17 Sep 2014 01:40:57 +0000 (UTC) Received: (qmail 79441 invoked by uid 500); 17 Sep 2014 01:40:52 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 79299 invoked by uid 500); 17 Sep 2014 01:40:52 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 79285 invoked by uid 99); 17 Sep 2014 01:40:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2014 01:40:52 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=HTML_FONT_FACE_BAD,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of garlanaganarasimha@huawei.com designates 119.145.14.66 as permitted sender) Received: from [119.145.14.66] (HELO szxga03-in.huawei.com) (119.145.14.66) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2014 01:40:47 +0000 Received: from 172.24.2.119 (EHLO szxeml456-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AUL70293; Wed, 17 Sep 2014 09:40:24 +0800 (CST) Received: from SZXEML501-MBX.china.huawei.com ([169.254.1.124]) by szxeml456-hub.china.huawei.com ([10.82.67.199]) with mapi id 14.03.0158.001; Wed, 17 Sep 2014 09:40:20 +0800 From: "Naganarasimha G R (Naga)" To: "user@hadoop.apache.org" , Mohammad Islam Subject: RE: Programatic way to recursively chmod a directory Thread-Topic: Programatic way to recursively chmod a directory Thread-Index: AQHP0fy+Eua3CHJvEEyAKslY/NPWlJwEi7LQ Date: Wed, 17 Sep 2014 01:40:19 +0000 Message-ID: References: <1410906125.54671.YahooMailNeo@web121704.mail.ne1.yahoo.com> In-Reply-To: <1410906125.54671.YahooMailNeo@web121704.mail.ne1.yahoo.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.18.148.62] Content-Type: multipart/alternative; boundary="_000_AD354F56741A1B47882A625909A59C692B400015szxeml501mbxchi_" MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020207.5418E688.0088,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=169.254.1.124, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 091e96dc1c0785f8d706c13b6be92d0f X-Virus-Checked: Checked by ClamAV on apache.org --_000_AD354F56741A1B47882A625909A59C692B400015szxeml501mbxchi_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Mohammad, If the user you are trying with has rights on the folder then you can try u= mask of 000 (like 777 - 000 =3D777 effective rights ) or you can check what is effective umask setting which you want to have, so= that files created by this user by default has the desired rights. Regards, Naga Huawei Technologies Co., Ltd. Phone: Fax: Mobile: +91 9980040283 Email: naganarasimhagr@huawei.com Huawei Technologies Co., Ltd. Bantian, Longgang District,Shenzhen 518129, P.R.China http://www.huawei.com =A1This e-mail and its attachments contain confidential information from HU= AWEI, which is intended only for the person or entity whose address is list= ed above. Any use of the information contained herein in any way (including= , but not limited to, total or partial disclosure, reproduction, or dissemi= nation) by persons other than the intended recipient(s) is prohibited. If y= ou receive this e-mail in error, please notify the sender by phone or email= immediately and delete it! ________________________________ From: Mohammad Islam [mislam77@yahoo.com] Sent: Wednesday, September 17, 2014 06:22 To: user@hadoop.apache.org Subject: Programatic way to recursively chmod a directory Hi, Is there a *programatic* solution to do it recursively? I'm using Hadoop 2.3.0. I tried the followings: 1. I tried FileSystem.mkdirs( path, permission), it created the directory b= ut the permission is not set correctly. 2. I tried FileSystem.setPermisison(path, permission), it changes only the = current directory not recursively. 3. I tried to use FileUtil.chmod() with no luck, 4. new FsShell(conf).run(new String[]{"-chmod" , "-R", "777", "/tmp/mislam"= }); it worked but looks like it is not a good solution to execute a shell. Questions : 1. Is there a solution for this? 2. If not, is there any JIRA for this? I didn't find one. 3. What next? Regards, Mohammad --_000_AD354F56741A1B47882A625909A59C692B400015szxeml501mbxchi_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Mohammad,
If the user you are trying= with has rights on the folder then you can try umask of 000  (like 77= 7 - 000 =3D777 effective rights )  
or you can chec= k what is effective umask setting which you want to have, so that files cre= ated by this user by default has the desired rights.


Regards,

Naga

 

Huawei Technologies Co., Lt= d.
Phone:
Fax:
Mobile:  +91 9980040283
Email: naganarasimhagr@huawei.com
Huawei Technologies Co., Ltd.
Bantian, Longgang District,Shenzhen 518129, P.R.China
http://www.huawei.com

<= /font>

= =A1This e-mail and its attachments contain confidential information from HUAWEI, w= hich is intended only for the person or entity whose address is listed abov= e. Any use of the information contained herein in any way (including, but n= ot limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the inte= nded recipient(s) is prohibited. If you receive this e-mail in error, pleas= e notify the sender by phone or email immediately and delete it!

From: Mohammad Islam [mislam77@yahoo.com]=
Sent: Wednesday, September 17, 2014 06:22
To: user@hadoop.apache.org
Subject: Programatic way to recursively chmod a directory

Hi,
Is there a *programatic* solution to do it recur= sively?
I'm using Hadoop 2.3.0.

I tried the followings:

1. I tried FileSystem.mkdirs( path, permission), it created the directory b= ut the permission is not set correctly. 

2. I tried FileSystem.setPermisison(path, permission), it changes only the = current directory not recursively.

3. I tried to use FileUtil.chmod() with no luck,

4. new FsShell(conf).run(new String[]{"-chmod" , "-R", = "777", "/tmp/mislam"}); it worked but looks like it is = not a good solution to execute a shell.


Questions :
1. Is there a solution for this?
2. If not, is there any JIRA for this? I didn't find one.
3. What next?  

Regards,
Mohammad
--_000_AD354F56741A1B47882A625909A59C692B400015szxeml501mbxchi_--