简体   繁体   English

TERMUX-bash:./a.out:权限被拒绝

[英]TERMUX- bash: ./a.out: Permission denied

在此处输入图像描述

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.我已经安装了clangtermux-setup-storage package。 My files are in main memory (not on sd card).我的文件在主 memory 中(不在 sd 卡上)。

Termux has only problem executing a.out file. Termux 只有执行a.out文件的问题。 If I make any error in C program it fails to compile the a.c file如果我在 C 程序中出现任何错误,它将无法编译a.c文件

You can't execute executable in internel storage because that's mount with noexec in android.您无法在内部存储中执行可执行文件,因为这是在 android 中使用 noexec 挂载的。 Move that binary somewhere in termux home directory or $PREFIX.将该二进制文件移动到 termux 主目录或 $PREFIX 中的某个位置。

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所以如果你需要运行这些文件而不是你需要运行$ ls //看你的文件是否在这里。如果不是改变目录$ mv a.out ~ $cd ~ $chmod +x a.out $./a.out

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM