TERMUX- bash: ./a.out: Permission denied
Asked Answered
G

3

8

enter image description here

Why do I keep getting this error?

>> gcc a.out
>> ./a.out
bash: ./a.out: Permission denied

I even tried this

>> chmod +x a.out

But still I keep getting the error. I have installed clang and termux-setup-storage package. My files are in main memory (not on sd card).

Termux has only problem executing a.out file. If I make any error in C program it fails to compile the a.c file

Glair answered 28/12, 2020 at 13:14 Comment(3)
What does ls -l a.out give?Fulton
ls -l a.out gives -rw-rw---- 1 root everybody 8176 Dec 28 19:20 a.out Looks like there is no x.Glair
@KangkanLahkar: it's probably due to execute bit disabled on sdcardTefillin
T
9

You can't execute executable in internel storage because that's mount with noexec in android. Move that binary somewhere in termux home directory or $PREFIX.

Thromboembolism answered 28/12, 2020 at 16:43 Comment(1)
cat /proc/mounts | grep storage/emulated | grep noexec, and there are lots of symbinks.Diathesis
P
0

so if you need to run those file than you need to run $ ls //to see your file is here or not .if not than change directory $ mv a.out ~ $cd ~ $chmod +x a.out $./a.out

Pictograph answered 6/11, 2021 at 19:55 Comment(0)
D
0

If you just installed termux api?

$ pkg install root-repo

Revoke termux app permission in settings.

$ termux-setup-storage

And taraa!!

Drucilla answered 15/11, 2022 at 11:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.