简体   繁体   English

拒绝执行权限

[英]Execl Permission Denied

Creating a producer/consumer system. 创建生产者/消费者系统。 The producer is meant to call the consumer but i am getting the error 生产者应该打电话给消费者,但我得到了错误

execl failed for producer: Permission denied

Here is the call: 这里是电话:

if (execl("/home/aaron/Documents/Programming/c/producerAsignment",   
          "runConsumer", NULL) == -1) {

     perror("execl failed for producer");
     exit(3);
}

I have tried putting the executable file into the same directory as the program calling it but that made no difference. 我尝试将可执行文件放入与调用它的程序相同的目录中,但这没什么区别。

ls -l /home/aaron/Documents/Programming/c/producerAsignment 
...
-rwxrwxr-x 1 aaron aaron 8760 Jan 10 22:28 runConsumer 
...

Ok, it turns out that the file you are trying to execute is actually a directory (see letter "d" at the beginning of the ls command output). 好的,事实证明您要执行的文件实际上是一个目录(请参见ls命令输出开头的字母“ d”)。 You cannot execute directories. 您无法执行目录。 Only files with the execute permission. 仅具有执行权限的文件。

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

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