i am kinda new to linux and in programming so please excuse my lack of knowledge.
I'm trying to run a basic program named trial.c with an executable file named trying but when I type ./trying in the terminal this error comes up:
bash: ./trying: Permission denied
The folder is on my HDD with 3 partitions, one for home, another for my ubuntu_files, and the other is a fat32 partition named MISC. The folder is inside the fat32 partition of my HDD.
the problem is no matter how much I try to use chown
and chmod
(both with recursive) to change the permission of the folder containing the trial.c and the executable(trying) file, the bash error message would still stay the same.
The user is nciacrklo, and i typed groups nciacrklo
to see what group is associated with that user and tried the codes found below in my terminal.
sudo chown nciacrklo:nciacrklo /media/nciacrklo/MISC/LibUsb -R -v
and after that it said:
ownership of `/media/nciacrklo/MISC/LibUsb/trying' retained as nciacrklo:nciacrklo
ownership of `/media/nciacrklo/MISC/LibUsb/trial.c' retained as nciacrklo:nciacrklo
and then,
sudo chmod 755 /media/nciacrklo/MISC/LibUsb -R -v
it then said,
mode of `/media/nciacrklo/MISC/LibUsb/trying' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)
mode of `/media/nciacrklo/MISC/LibUsb/trial.c' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)
finally, I tried the ./trying
again but same error appeared.
bash: ./trying: Permission denied
please please help me I'm struggling with this and yet I have to do lots of programming about the LibUsb topic >.<.
any comments about how to use LibUsb to acquire pictures from webcam would also be much help. Thanks!!! \m/,
chmod +x
on the file./trying
-chmod +x ./trying
- this should make it executable. Also, with thetrial.c
program, you may need to compile it first usinggcc
- look atman gcc
in terminal. There is a great page on chmod here. The permissions of the file should not berw-r--r--
, butrwxr--r-x
for it to execute (I think - basically, it should havex
in it somewhere).