Does Chmod work in any directory?? Newbie question

giga

Well-Known Member
Licensed User
Longtime User

warwound

Expert
Licensed User
Longtime User
I can't answer you question - but remember that an SD card is generally formatted as FAT32 and FAT32 has no support for any features of the Linux file system - such a permissions.

Martin.
 
Upvote 0

giga

Well-Known Member
Licensed User
Longtime User
I can't answer you question - but remember that an SD card is generally formatted as FAT32 and FAT32 has no support for any features of the Linux file system - such a permissions.

Martin.

Thanks for the reply warwound, I will keep the FAT types in mind. All I am trying to do is put a file in the sdcard or /data/data/my-app/files directory with just RWX permissions.

Strangely, I tried and downloaded a test apk from the web and that one can create a RWX file in their /data/data/their-app/files directory on the same emulator.

?? How can they get access and I can't ??

Just not my app. :(

P.S I can do it through ADB, but that doesn't solve my problem with each phone.
 
Upvote 0

giga

Well-Known Member
Licensed User
Longtime User
can't CHMOD bin file in my app-directory

Is there a library similar in B4A. That makes the bin file executable at runtime?

java has this code that works on android

B4X:
private String MakeExecutable(String filename) {
//First get the absolute path to the file
File folder = m_context.getFilesDir();

String filefolder = folder.getCanonicalPath();
if (!filefolder.endsWith("/"))
filefolder += "/";

String fullpath = filefolder + filename;

Runtime.getRuntime().exec("chmod 770 " + fullpath).waitForExit();

return fullpath;

Any help appreciated. :) Thanks in advance
 
Upvote 0
Top