File access Permissions
Android 's file access control is the same as Linux.
File access permissions: Who can access this file. Use drwxrwxrwx This is a character control
First letter
D: Indicates folder
-: Indicates file
Each of the following three letters is divided into a group
First group : rwx is the permission of the owner of the file
R:read, read
W:write, write
X:execute, Executive
-: Indicates that the permission is not
Second group : rwx represents the permissions that a user with a group of files owns to a file
R:read, read
W:write, write
X:execute, Executive
-: Indicates that the permission is not
Group Three:rwx represents the permissions that other users have on the file
R:read, read
W:write, write
X:execute, Executive
-: Indicates that the permission is not
Who creates the file, who owns the file, and the first set of permissions is the owner's permission
Any application, for other applications, is another user.
By default, the creator of the file has read and write permissions, and no other user has any permissions.
microsoftinternetexplorer402documentnotspecified7.8 lbs Normal0
Package Com.test.storage;
Import java.io.FileNotFoundException;
Import android.app.Activity;
Import Android.os.Bundle;
Import Android.view.View;
public   class createfiledemo   extends   activity {
@Override
protected   void   oncreate ( bundle savedinstancestate) {
// auto-generated method stub
super oncreate (savedinstancestate);
setcontentview ( r layout activity_main
}
public void   click Span style= "font-family: Song body; Color: #000000; Font-size:12.0000pt "> ( view v) {
path defaults to data/data/ app label package name /files/ cannot be changed
/* first parameter, file name
* The second parameter , mode_private , indicates that the file is private and cannot be modified by others, overwriting the previous content when it is written again .
*mode_append indicates that the file is private and cannot be modified by others, and is appended to the contents of the previously written file when it is written again .
*mode_world_readable is used to control whether other applications have permission to read and write to the file, indicating that the current file can be read by other applications
*mode_world_writeable is used to control whether other apps have permission to read and write to the file, indicating that the current file can be written by another application
* multiple modes can be used | Connection
*/
try {
openfileoutput ( Span style= "font-family: Song body; Color: #000000; Font-size:12.0000pt ">,  mode_world_readable
} ( filenotfoundexception e) {
E. Printstacktrace ();
}
}
}
Android File access rights