c - Unable to run compiled files - bash: ./a.out: Permission denied. (I've tried chmod) -


i've compiled c source using cc test.c, , did generate a.out file.

however when run error -

bash: ./a.out: permission denied 

my source not in home directory, on different fat-32 partition, i've mounted drive in code using following command -

$ udisks --mount /dev/sda7 --mount-options umask=022 mounted /org/freedesktop/udisks/devices/sda7 @ /media/48e9-fd53 $ cd /media/48e9-fd53/c 

then compile code using cc

i've tried gcc. still same error.

then did - chmod +x a.out, still same problem. with(chmod 755 a.out) , chmod u+x a.out.

i've tried compiling , executing program using sudo.

i've tried - sudo chown sannidhya:sannidhya a.out.

i've tried every thing found after googling, still couldn't work.

how can run .out file (without moving home directory)?

note - using ubuntu 12.04 lts.

but weird thing here is, after running chmod +x a.out, on running - ls -l a.out, get-

-rw-r--r-- 1 

also when check properties of a.out, under permissions tab, when check allow executing file program,the tick appears , disappears.

seems you've mounted partition with no-exec flag set. you'll have remount partition:

sudo mount -o remount -o exec /dev/sda7 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

node.js - Bad Request - node js ajax post -

uitableview - Create and use custom prototype table cells in xamarin ios using storyboard -