How do you make a shared network file read-only using Python?
<p>Using Python, what's the correct way to set a file to be read-only when the file is located on a network share (being served from a Windows 2003 Server)?</p>

<p>I'm running Python 2.6.2 in OS X (10.6.1).</p>

<p>The following code throws an exception (as expected) when path is local, but <code>os.chmod</code> appears to have no effect when path points to a Windows share.</p>

<pre><code>import os, stat

path = '/Volumes/Temp/test.txt'

# Create a test file.
open(path, 'w').close()

# Make the file read-only.
os.chmod(path, stat.S_IREAD)

# Try writing to it again. This should fail.
open(path, 'w').close()
</code></pre>
