Saving a file to a system directory?

Put your problem here if it does not fit any of the other categories.

Saving a file to a system directory?

Postby ringer » Thu Nov 06, 2008 7:35 pm

Hey folks,

I'm trying to save a file to a system folder. I know the default directory for saving files to the device is in your local data folder, as so:

String dir = getFilesDir().toString();
// dir is "/data/data/<app>/files"

I'm wondering if it's possible to save files to another directory, such as: /system/media/audio/ringtones ?

This doesn't seem to work: getFileStreamPath("/system/media/audio/ringtones/").mkdirs();

Any help would be much appreciated - thanks!
ringer
Freshman
Freshman
 
Posts: 2
Joined: Tue Nov 04, 2008 11:51 pm

Top

Postby MrSnowflake » Thu Nov 06, 2008 9:51 pm

You can't! The userid your app is installed under doesn't have write rights in those system folders, luckily, so malisious software can't brick your phone. See it as Windows safety against Unix/GNU/linux/bsd/...
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests