Hadoop setting fsPermission recursively to dir using Java -
Hi, I have a test program that loads the file in this way
user / user / data / app / type /
This test program now runs multiple users multiple times. That's why I want to permit the file to RVX so that anyone can remove this file. I have the following code fs.setPermission (new path ("user / user1 / data"), new FsPermission (FsAction.ALL, FsAction.ALL, FsAction.ALL))
The line above gives all the dirs drwxrwxrwx but for file.gz it allows it as -rw-rrr - Why? For this reason, other users are not able to delete this file through the testing program. I can delete the file through the examination program because I have full permission.
Please guide. I'm new to headache thanks in advance.
Using the FS-Shell API my DIR permission problem has been solved. This can not be the optimal way, but since I solve it for testing code, then it should be fine.
FsShell shell = new FsShell (conf); Try {shell.run (new string [] {"- chmod", "- R", "777", "user / usr1 / data"}); } Hold (exception e) {LOG.error ("Could not change file permissions", e); New IOException Throw (E); }
Comments
Post a Comment