File: mergeall-android-scripts/_readme-items/LOGS/permissions-usb-sd-internal-updates.txt

####################################################################### 
# Show that USB drives have the same storage constraints as SD cards.
# 
# In the following:
#     /storage/5C3D-EB80 is an attached USB flashdrive
#     /storage/6C2A-1618 is the phone's removable microSD card
#     /sdcard is the phone's internal storage (a.k.a shared)
# 
# Tests here are run in Termux, and assume it has already been granted
# extra storage permissions by running its "termux-setup-storage" tool.
#######################################################################


# The app-specific folder on USB and SD media is writeable 

$ echo 'xxx' > /storage/5C3D-EB80/Android/data/com.termux/test.txt
$ echo 'xxx' > /storage/6C2A-1618/Android/data/com.termux/test.txt


# But no other parts of USB or SD media are writeable 

$ echo 'xxx' > /storage/5C3D-EB80/test.txt      
bash: /storage/5C3D-EB80/test.txt: Permission denied
$ echo 'xxx' > /storage/6C2A-1618/test.txt
bash: /storage/6C2A-1618/test.txt: Permission denied

$ echo 'xxx' > /storage/5C3D-EB80/Android/test.txt
bash: /storage/5C3D-EB80/Android/test.txt: Permission denied
$ echo 'xxx' > /storage/6C2A-1618/Android/test.txt
bash: /storage/6C2A-1618/Android/test.txt: Permission denied

$ echo 'xxx' > /storage/5C3D-EB80/Android/data/test.txt
bash: /storage/5C3D-EB80/Android/data/test.txt: Permission denied
$ echo 'xxx' > /storage/6C2A-1618/Android/data/test.txt
bash: /storage/6C2A-1618/Android/data/test.txt: Permission denied 


# Even though internal storage can be written anywhere...

$ echo 'xxx' > /sdcard/test.txt
$ echo 'xxx' > /sdcard/Android/test.txt
$ echo 'xxx' > /sdcard/Android/data/test.txt
$ echo 'xxx' > /sdcard/Android/data/com.termux/test.txt



[Home page] Books Code Blog Python Author Train Find ©M.Lutz