On 28 Nov 2020 18:48:36 GMT, Frank Slootweg wrote:
> I don't think there is a standard, because - as I mentioned - on my
> device the *SD-card* is - amongst others - /storage/sdcard0.
Hi Frank,
Thank you for clarifying, as I had thought you had made a mistake, so I
apologize, where what you're saying is your _external_ sdcard is called
"sdcard0", whereas my _internal_ sdcard is called "sdcard0".
I appreciate that you clarified as not only is it confusing that every OEM
seems to use a different designation, but Usenet is particularly difficult
to clarify due to the nature of the medium.
I'm well aware you're not paid to help me (nor am I paid to write
tutorials), so it's with sincere appreciation that I thank you for
clarifying:
o On your Android device, /storage/sdcard0 is the _external_ sdcard.
o On my Android device, /storage/sdcard0 says "no such file or directory"
>> Likewise, the same thing happened with "/sdcard":
>> o Termux: cd /sdcard/0data => works
>> o Termux: cd /sdcard/1data => no such file or directory
>
> Bummer! So on your device /sdcard is a directory, while on my device
> it's a symbolic link which points directly to the SD-card.
Yes. I agree.
I like how yours is done, where Motorola "claims" to be more "stock Android
10", where I don't remember what yours is, but a Pixel might be a good test
of what "stock" Android 10 uses for the filespec.
The only internal-storage paths that work:
o /storage/emulated/0/{mystuff}
o /mnt/sdcard/{mystuff}
The only external-storage path that works:
o /storage/B31E-4294/{mystuff}
I suspect the reason (minor) things broke when I swapped external sdcards
was that each external sdcard always seems to have a _unique_ name.
If we, together, on Usenet, the whole team, can figure out how to _change_
the otherwise-unique name of the sdcard, then sdcard swaps would work
better since the symbolic links all failed, as did homescreen shortcuts.
> You shouldn't try all kinds of 'cd' commands, only to have them fail,
> but browse the logical places, starting at the root ('/'), use 'ls -l'
> to see what a thing is / things are, i.e. is some path a directory, a
> symbolic link, a file, etc. and use that information.
I don't really understand _why_ the "ls" fails on non-rooted Android.
For example:
o Termux: ls /storage/emulated/0 ==> Permission denied
o Termux: ls /storage/emulated/0/ ==> Permission denied
o Termux: ls /storage/emulated/0/0data ==> Permission denied
Then watch what happens when I simply do a "cd" and then "ls":
o Termux: cd /storage/emulated/0/0data ==> works
o Termux: pwd ==> reports /storage/emulated/0/0data
o Termux: ls ==> Permission denied
Go figure.
It even happens at the _next_ level:
o Termux: cd /storage/emulated/0/0data/apk ==> works
o Termux: pwd ==> reports /storage/emulated/0/0data/apk
o Termux: ls ==> Permission denied
I don't know why, offhand, I can cd into a directory, but not ls it.
> Also the 'mount' command should tell you what is mounted where.
Ah, good advice. Let's try that, oooh, nice, lots of output.
o Termux: cd /storage/emulated/0/0data ==> works
o Termux: mount > mount.txt ==> permission denied
Drat... let's try the external sdcard:
o Termux: cd /storage/emulated/0/0data ==> works
o Termux: touch mount.txt ==> permission denied
Hmmmm... the "termux user" has almost no permissions:
o Termux: cd ~ ==> works
o Termux: pwd ==> reports /data/data/com.termux/files/home
o Termux: mount > mount.txt ==> works
The problem is I can't "see" the "com.termux" in /data/data
so I can't access that mount.txt file, but I can cat it out:
o Termux: cat mount.txt | more ==> works
(it's too much to copy by hand though to put here)
> IOW, with Termux you have basic Unix commands at your disposal, so use
> them and use them with Unix/Linux insight.
I rarely use Termux, so I'm not sure what the problem is, but I think it's
just that the default permissions for the "termux user" need to be opened
up a bit.
I never needed these permissions so I'm not sure if it's as easy as chmod
o But I can't even _copy_ ~/mount.txt file to any directory I can "see".
Even my file manager won't "see" the termux-user home directory.
o What I need is to figure out why Termux has so few permissions
If anyone here knows, offhand, how to give the termux user, at the very
least, the same permissions as the Android user normally has, that would be
nice, as the termux-users seems vastly limited in its permissions.
Probably there's a setup on the permissions I may have missed but I need
o OK. There is. Who knew? Not me. (termux-setup-storage)
<
https://wiki.termux.com/wiki/Internal_and_external_storage>
"Allow Termux to access photos, media and files on your device?"
But that's a different problem than that of setting the external sdcard
filespec to something simpler than what it is currently.
o /storage/B31E-4294/{mystuff}
--
What would help everyone is a way to change the external sdcard filespec.