title: check if directory exists on remote machine before sftp
body: <p>this my function that copies file from local machine to remote machine with paramiko, but it doesn't check if the destination directory exists and continues copying and doesn't throws error if remote path doesn't exists</p>
  
  <pre><code>def copyToServer(hostname, username, password, destPath, localPath):
      transport = paramiko.Transport((hostname, 22))
      transport.connect(username=username, password=password)
      sftp = paramiko.SFTPClient.from_transport(transport)
      sftp.put(localPath, destPath)
      sftp.close()
      transport.close() 
  </code></pre>
  
  <p>i want to check if path on remote machine exists and throw error if not.</p>
  
  <p>thanks in advance</p>