Windows 7 file permission issues w/Python
<p>So I'm currently using a python program a friend wrote in order to quickly run hundreds of files at once. I'm receiving some kind of file permissions error. I've already lowered UAC to lowest and other than that I'm not sure what else it could be, as I've tried multiple directories. </p>

<p>Here's the code:</p>

<pre><code>import os 
import fnmatch
import subprocess

matches = []
outputs = []
foutputs = []
for root, dirs, files in os.walk("C:\\Users\\Freeman\\Desktop"):
    for files in fnmatch.filter(files, '*.c'):
        matches.append(os.path.join(root,files))
        outputs.append(os.path.join(root,"a.exe"))
        foutputs.append(os.path.join(root,"out.txt"))

for n,m,l in zip(matches, outputs, foutputs):
    print n

    # Compile
    cmd = ['gcc', '-O2', n, '-o', m]
    p = subprocess.call(cmd, shell=True)
    fin = file("C:\\Users\\Freeman\\Desktop")

    # Set up append mode for output
    if os.path.exists(l):
        os.remove(l)

    fout = file(l,"a")
    if os.path.exists(m):
        # Test multiple cases
        p = subprocess.Popen(m, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
        fout.write(repr(p.communicate(fin.readline())))
</code></pre>

<p>And here's the error I'm receiving: </p>

<pre><code>C:\Users\Freeman\Desktop\Assignment 3\Assignment 3- Abdulrahman Ruaa  - 13015067923101\assigh 3.c
</code></pre>

<p>^^This is the first user's code thats supposed to run</p>

<pre><code>Traceback (most recent call last):
    File "C:\Users\Freeman\Desktop\Assignment 3\test.py", line 20, in &lt;module&gt;
        fin = file("C:\\Users\\Freeman\\Desktop")
IOError: [Errno 13] Permission denied: 'C:\\Users\\Freeman\\Desktop'
</code></pre>

<p>^^Thats the directory issue, and I've tried different directories as stated to no avail. </p>

<p>Thank you for your consideration. </p>

<p>Regards,</p>

<p>Michael</p>
