how to create a file with world readable permission under subdirectory of files directory

前端 未结 4 1003
迷失自我
迷失自我 2020-12-29 07:05

I need to create files under myapp/files/subdir with global permission in my application. I do this because I use external applications to open some files Using this

<
4条回答
  •  感动是毒
    2020-12-29 07:43

    One workaround I used in the past was to re-open the already existing file using openFileOutput in append mode, and pass in the world readable and/or world writable flags during that time. Then immediately close the file without writing to it.

    I like the new methods added in API 9 better though.

提交回复
热议问题