hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naganarasimha G R (Naga)" <garlanaganarasi...@huawei.com>
Subject RE: Programatic way to recursively chmod a directory
Date Wed, 17 Sep 2014 01:40:19 GMT
Hi Mohammad,
If the user you are trying with has rights on the folder then you can try umask of 000  (like
777 - 000 =777 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.



Huawei Technologies Co., Ltd.
Mobile:  +91 9980040283
Email: naganarasimhagr@huawei.com<mailto:naganarasimhagr@huawei.com>
Huawei Technologies Co., Ltd.
Bantian, Longgang District,Shenzhen 518129, P.R.China

¡This e-mail and its attachments contain confidential information from HUAWEI, which is intended
only for the person or entity whose address is listed above. Any use of the information contained
herein in any way (including, but not limited to, total or partial disclosure, reproduction,
or dissemination) by persons other than the intended recipient(s) is prohibited. If you 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

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 but 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?


View raw message