Farhan
Farhan

Reputation: 3226

Set file permission

I have an application that shows a list of video files contained on the external storage. Currently the contents on the external storage (like video files) are in read-only mode. They can't be deleted. I want to delete these files; however, I need to change the permission (from read only to read-write).. Is it possible to change the permission of a file programmatically ?

Upvotes: 0

Views: 4533

Answers (2)

Ron
Ron

Reputation: 24235

You can run the "chmod" command using the Process object.

Upvotes: 0

Femi
Femi

Reputation: 64700

Try using setWritable.

EDIT: Note that this only exists in API versions 9 and above.

Upvotes: 4

Related Questions