Kaneda
January 25th, 2011, 09:55 PM
I've just started a Fortran class, and I do a lot of my work on the windows machines at the school, but it's nice to work on my ubuntu machine from time to time as well.
After I compile a program and try running it with:
./ast2
I get the following error:
bash: ./ast2: Permission denied
So, I tried changing the permissions:
chmod a+x ast2
But, no luck. It still didn't work. (sudo didn't work, either) However, the file is on a flash drive, so I copied it to my home folder. I tried running it again there, and it didn't work, but then I changed the permissions there and ran again, and it worked.
I even tried going in through the GUI file manager and changing the permissions, but when I check the "Allow executing file as program" box, it just unchecks itself right after.
Output of ls -l, by the way is:
$ ls -l
total 73352
-rw-r--r-- 1 zen zen 223 2011-01-20 16:53 a1out.txt
-rwxr-xr-x 1 zen zen 875078 2011-01-20 16:53 ast1.exe
-rw-r--r-- 1 zen zen 2436 2011-01-24 18:11 ast1.f95
-rw-r--r-- 1 zen zen 2592 2011-01-20 16:53 ast1.f95~
-rw-r--r-- 1 zen zen 138894 2011-01-19 17:13 ast1hnd.pdf
-rw-r--r-- 1 zen zen 11751 2011-01-25 11:35 ast2
-rwxr-xr-x 1 zen zen 878809 2011-01-24 18:08 ast2.exe
-rw-r--r-- 1 zen zen 2127 2011-01-24 18:07 ast2.f95
-rw-r--r-- 1 zen zen 2120 2011-01-24 18:05 ast2.f95~
(The .exe files are from when I compiled the programs on a windows machine)
So, here's my question: How do I get it so I can run the file off of the flash drive?
And a second question: Assuming I get to where I can run off the flash drive, it's still kind of annoying to have to change the permissions for each program I write before I can execute it. Is there anyway I can automate the process or get around it?
Thanks a lot!
After I compile a program and try running it with:
./ast2
I get the following error:
bash: ./ast2: Permission denied
So, I tried changing the permissions:
chmod a+x ast2
But, no luck. It still didn't work. (sudo didn't work, either) However, the file is on a flash drive, so I copied it to my home folder. I tried running it again there, and it didn't work, but then I changed the permissions there and ran again, and it worked.
I even tried going in through the GUI file manager and changing the permissions, but when I check the "Allow executing file as program" box, it just unchecks itself right after.
Output of ls -l, by the way is:
$ ls -l
total 73352
-rw-r--r-- 1 zen zen 223 2011-01-20 16:53 a1out.txt
-rwxr-xr-x 1 zen zen 875078 2011-01-20 16:53 ast1.exe
-rw-r--r-- 1 zen zen 2436 2011-01-24 18:11 ast1.f95
-rw-r--r-- 1 zen zen 2592 2011-01-20 16:53 ast1.f95~
-rw-r--r-- 1 zen zen 138894 2011-01-19 17:13 ast1hnd.pdf
-rw-r--r-- 1 zen zen 11751 2011-01-25 11:35 ast2
-rwxr-xr-x 1 zen zen 878809 2011-01-24 18:08 ast2.exe
-rw-r--r-- 1 zen zen 2127 2011-01-24 18:07 ast2.f95
-rw-r--r-- 1 zen zen 2120 2011-01-24 18:05 ast2.f95~
(The .exe files are from when I compiled the programs on a windows machine)
So, here's my question: How do I get it so I can run the file off of the flash drive?
And a second question: Assuming I get to where I can run off the flash drive, it's still kind of annoying to have to change the permissions for each program I write before I can execute it. Is there anyway I can automate the process or get around it?
Thanks a lot!