title: Unable to run compiled files - bash: ./a.out: Permission denied. (I've tried chmod)
body: <p>I've compiled my C source using <code>cc test.c</code>, and it did generate <code>a.out</code> file.</p>
  
  <p>However when I run it I get this error - </p>
  
  <pre><code>bash: ./a.out: Permission denied
  </code></pre>
  
  <p>My source is not in the home directory, it is on different FAT-32 partition, so I've mounted the drive in which the code is using the following command - </p>
  
  <pre><code>$ udisks --mount /dev/sda7 --mount-options umask=022
  Mounted /org/freedesktop/UDisks/devices/sda7 at /media/48E9-FD53
  $ cd /media/48E9-FD53/C
  </code></pre>
  
  <p>Then I compile my code using <code>cc</code></p>
  
  <p>I've also tried <code>gcc</code>. But still I get the same error.</p>
  
  <p>Then I did - <code>chmod +x a.out</code>, still the same problem. Also with(<code>chmod 755 a.out</code>) and <code>chmod u+x a.out</code>.</p>
  
  <p>I've also tried compiling and executing the program using <code>sudo</code>.</p>
  
  <p>I've also tried - <code>sudo chown sannidhya:sannidhya a.out</code>.</p>
  
  <p>I've tried every thing that I found after googling, still couldn't get it to work.</p>
  
  <p>How can I run <code>.out</code> file (without moving it to home directory)?</p>
  
  <p><strong>Note</strong> - I am using Ubuntu 12.04 LTS.</p>
  
  <p>But a <strong>weird thing</strong> here is, even after running <code>chmod +x a.out</code>, on running - <code>ls -l a.out</code>, I get-</p>
  
  <pre><code>-rw-r--r-- 1
  </code></pre>
  
  <p>also when I check the properties of <code>a.out</code>, under <strong>Permissions</strong> tab, when I check <code>Allow executing file as program</code>,the tick appears and quickly disappears.</p>