[Edify question]-piping not working-how to selectively chmod certain files?

Status
Not open for further replies.
Search This thread

vinconti

Senior Member
Feb 21, 2007
93
5
I am trying to get my android updater-script to selectively change permissions based on filename. I want all files under a certain subdirectory following the naming pattern "A.xy" set to 0755 and all other files set to 0644

So I first set all of them to 0644, then tried to selectively set the rest to 0755 by piping commands using xargs and exec. However, neither of the following commands worked but neither of them gave an error. Does anyone have a better way of doing this, or have an idea why neither of these worked?

run_program("/sbin/busybox", "find", " /data/app", "-name", "A.xy", "-type", "f", "-print0", "|", "/sbin/busybox", "xargs", "-0", "chmod", "0644");

run_program("/sbin/busybox find /data/app -name A.xy -type f -exec chmod 0644 {} \;");

It seems like update-binary doesn't allow piping? It doesn't give an error though.

Any idea how I can set all files of one type to be one permission, and all files of another type to be a different permission?
 
Status
Not open for further replies.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone