File access rights under Android

Source: Internet
Author: User

  

      

File permissions:----------

A total of 10 identifiers

The first-:d--> indicates that the folder l--> represents a shortcut-represented as a file

Section (2-4): Indicates the current user right rw-readable writable rwx readable writable executable

Section (5-7): Indicates the current user group's permissions

Paragraph (8-10): Represents a permission other than the current group

As shown in the following:

Private file permissions:-rw-rw----Binary 110 110 0 binary 660

Readable file permissions:-rw-rw-r--binary 110 110 1000 binary 664

Writable file permissions:-rw-rw--w-corresponding binary 110 110 100 binary 662

Publicly readable writable:-rw-rw-rw-corresponding binary 110 110 1100 binary 666

Ways to Modify Permissions

ADB shell

cd/data/data/Package Name/files/

Ls-l display all files and access rights under the Files folder

Chmode 666 Private.txt (Chmode indicates that the change mode command line parameter 666 indicates the binary private.txt of the permission to be modified represents the file to be modified)

This.getfilesdir ()/data/data/package name/files/

This.getcachedir ()/data/data/package name/cache/cache path

Openfileoutputstream (name,code)/data/data/package name/files/

Code means permission

Context.mode_private Private

Context.mode_world_readable readable

Context.mode_world_writeable can write

Context.mode_world_readable+context.mode_world_writeable readable + writable

  

File access rights under Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.