Rubicon
Rubicon

Reputation: 379

Is /data/data always writable?

I'm writing an app for rooted Android devices. The app needs to copy files to /data/data.

Is it safe to assume that this partition will always be mounted R/W, or should the app double-check the mount options?

Upvotes: 0

Views: 2499

Answers (3)

Squonk
Squonk

Reputation: 48871

The path /data/data is in internal storage so should never be dismounted.

One thing though, use the methods provided such as Context.getFilesDir() to get the correct path to a directory that your app can write to. Don't assume you can write to /data/data/some/directory because internal storage has permissions associated with it.

Upvotes: 2

lrAndroid
lrAndroid

Reputation: 2854

/data/data is always in R/W on rooted devices. I would do a root check in your app though, just to make sure you don't run into errors.

Upvotes: 0

waqaslam
waqaslam

Reputation: 68177

The internal memory containing such folders should always be available as write-able. However, there are no guarantees for SD card with these folders, since the card can be unmounted at any time.

Upvotes: 1

Related Questions