title: How to know current working directory in sftp from python
body: <p>I had connected to sftp with some details to fetch some files with paramiko from python
  and code is below</p>
  
  <pre><code>import paramiko
  import os
  import ftplib
  
  ssh = paramiko.SSHClient()
  ssh.set_missing_host_key_policy( paramiko.AutoAddPolicy() )
  ssh.connect('sftp.example.com', username='user', password='pass')
  ftp = ssh.open_sftp()
  files = ftp.listdir()
  print files,"----&lt; Total files"
  print ftp.cwd(),"---&lt; Current working diectory"
  
  for feedFile in files:
      if feedFile == 'LifeBridge':
          ftp.chdir(feedFile)
  </code></pre>
  
  <p><strong>Result</strong></p>
  
  <pre><code>['Emerson', 'Lehighvalley', 'LifeBridge', 'stmaryct'] ----&lt; Total files
  
  File "test_sftp.py", line 11, in &lt;module&gt;
      print ftp.cwd()   ---&lt; Current working diectory
  AttributeError: 'SFTPClient' object has no attribute 'cwd'
  </code></pre>
  
  <p>here what i am doing is </p>
  
  <ol>
  <li><p>Trying to find the current working directory of sftp</p></li>
  <li><p>There is a list of files above  which i got as a result for printing files, i am trying to check whether they are folders or files,
  If they are folders i want to enter in to  <code>LifeBridge</code> folder</p></li>
  </ol>
  
  <p>Finally can anyone let me know the following</p>
  
  <ol>
  <li>how to check the current working directory of sftp</li>
  <li>how to check whether result from the above list is a file or a folder</li>
  </ol>