2

I need to set new permissions on some files in aosp. I am using FileUtils.setPermissions(). But when I make a check using FileUtils.getPermissions I get the same permissions always as "33188" and I want it to be 0777.

How can I do it. BTW I am doin this operation in PacakageManagerService.java.

4

1 回答 1

1

您应该首先构建应该传递给的所需值FileUtils.setPermission。例如,在您的情况下,代码可能如下:

int perm = FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IRWXO;
FileUtils.setPermissions(fileName, perm, ...);
于 2012-06-20T08:35:45.210 回答