Termux is acting cringe lately with accessing/reading some files

So Termux for some reason could not read nor list available files in one of my directories. If I try to forcefully open an unlisted file, it just says
permission denied
permission denied
Like how in the heck could it break like that? Tried re-enabling file permissions, running
termux-setup-storage
termux-setup-storage
again - same thing. It's just a big inconvenience, because there are a dozen of files and I'm just too lazy to recreate them. TLDR; Android file managers could R/W those files just fine.
No description
10 Replies
Biswa96
Biswa96•2mo ago
stat /path/to/file ?
Airis (airidosas252)
/sdcard/glibc-wine $ stat glibc-variables
File: glibc-variables
Size: 1625 Blocks: 8 IO Block: 4096 regular file
Device: 0,194 Inode: 2251993 Links: 1
Access: (0660/-rw-rw----) Uid: (10276/ u0_a276) Gid: ( 1023/media_rw)
Access: 2024-05-28 17:24:42.000000000 +0300
Modify: 2024-05-28 17:24:42.000000000 +0300
Change: 2024-05-28 17:24:42.278299324 +0300
Birth: -
/sdcard/glibc-wine $ stat glibc-variables
File: glibc-variables
Size: 1625 Blocks: 8 IO Block: 4096 regular file
Device: 0,194 Inode: 2251993 Links: 1
Access: (0660/-rw-rw----) Uid: (10276/ u0_a276) Gid: ( 1023/media_rw)
Access: 2024-05-28 17:24:42.000000000 +0300
Modify: 2024-05-28 17:24:42.000000000 +0300
Change: 2024-05-28 17:24:42.278299324 +0300
Birth: -
One of the files I cannot read/write/see listed
Biswa96
Biswa96•2mo ago
In my phone, the /sdcard files have same permission & owner as yours but I can open/edit them in nano. I am curious about this issue too.
Airis (airidosas252)
I genuinely have no idea what happened, but it was absolutely fine like 15 minutes ago till I rebooted Termux, tried launching my Wine script and then bam, permission denied errors, like what? 😅
tomikun
tomikun•2mo ago
You seem to be running glibc stuff Are you sure you're in glibc-runner shell though?
Airis (airidosas252)
I don't think that's related to inability to access some files It was working just fine a few moments ago
tomikun
tomikun•2mo ago
try restarting the phone, if that fails, use an external file manager that uses SAF and move the affected files somewhere else, then move it back if even that fails am curious to see what adb shell would show if you ls -l the affected files
Airis (airidosas252)
I noticed that Termux does not see files with certain extensions, like .zip, .pdf, .diff How in the hell... And no, reboot did not fix a thing unfortunately
tomikun
tomikun•2mo ago
what about the other stuff i said
Airis (airidosas252)
So what was wrong in the end: - My whole Termux prefix got corrupted, meaning some of the libraries no longer worked. Tried reinstalling them - no dice. And since I was using pacman prefix, that might explain some of the issues. - Regarding file access - so apparently there's "All files access" hidden inside "Special access" tab inside Settings and this exact permission disallowed me to open most of the files. After enabling it back - files are accessible again. Closing this ticket, because I'm currently reinstalling everything. 😁