Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >> hdfs -copyToLocal file permission


Copy link to this message
-
Re: hdfs -copyToLocal file permission
No, permissions are not preserved.  FsShell copy commands match *nix's cp behavior by using the current umask (the conf setting you cited) for the permissions of new file.  Perhaps we could add a -p option, like the *nix cp, to preserve permissions.  In the meantime you can set the umask if most of your files have the same permissions.

Daryn

On Jun 10, 2013, at 6:07 AM, Abhishek Gayakwad wrote:

Hi,

While copying file from hdfs file permissions are getting changed, my assumption was that while copying permissions should be retained. Is this behavior correct ?
[abhishek@int019 ~]$ hdfs dfs -ls
drwxr-xr-x   - abhishek abhishek          0 2013-06-06 10:14 in-dir1

[abhishek@int019 ~]$ hdfs dfs -ls in-dir1
Found 2 items
-rw-r--r--   3 abhishek abhishek          0 2013-06-06 10:10 in-dir1/_SUCCESS
-rw-r--r--   3 abhishek abhishek 5000000000 2013-06-06 10:10 in-dir1/part-00001

[abhishek@int019 ~]$ hdfs dfs -copyToLocal in-dir1/part-00001
[abhishek@int019 ~]$ ll
total 4887604
-rwxr-xr-x 1 abhishek abhishek 5000000000 Jun 10 06:08 part-00001
[abhishek@int019 ~]$ umask
0002

fs.permissions.umask-mode is not set so I think it defaults to 0022

Thanks,
Abhishek

NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB