title: Permission Denied to Other App after makedirs()
body: <p>When I have a Python app running on a server which is creating folders like this</p>
  
  <pre><code>    if not os.path.exists(destinationPath):
          os.makedirs(destinationPath, 777)
  </code></pre>
  
  <p>I have a client app (also in Python) uploading files to the server via SFTP using the <a href="http://www.lag.net/paramiko/" rel="nofollow">Paramiko module</a>. The client also creates folders on the server if needed like this</p>
  
  <pre><code>    makeCommand = 'mkdir -p "' + remotePath + '"'
          ssh.exec_command(makeCommand)
  </code></pre>
  
  <p>and this works fine. The problem I'm having is that if the server app makes a folder, the client doesn't have access to that folder (can't upload to it or create subfolders). I get the following error</p>
  
  <pre><code>   line 104, in upload
  ftMan.sftp.put(localFile, remoteFile)
  File "build/bdist.macosx-10.8-intel/egg/paramiko/sftp_client.py", line 565, in put
  File "build/bdist.macosx-10.8-intel/egg/paramiko/sftp_client.py", line 245, in open
  File "build/bdist.macosx-10.8-intel/egg/paramiko/sftp_client.py", line 635, in _request
  File "build/bdist.macosx-10.8-intel/egg/paramiko/sftp_client.py", line 682, in _read_response
  File "build/bdist.macosx-10.8-intel/egg/paramiko/sftp_client.py", line 710, in _convert_status
  IOError: [Errno 13] Permission denied
  </code></pre>
  
  <p>How can I have each app create folders that the other can use also? I've tried setting permissions (as you can see in the first piece of code for the server above) but this doesn't seem to be working?</p>