title: Explanation of pysftp.Connection.walktree() parameters
body: <p>I have just started using Python's pysftp and I am confused as how to call it's <code>walktree</code> function.</p>
  
  <p>I found some code (found at <a href="http://pydoc.net/Python/pysftp/0.2.8/pysftp/" rel="noreferrer">http://pydoc.net/Python/pysftp/0.2.8/pysftp/</a>) that helped me better understand what form my parameters should take</p>
  
  <pre><code>def walktree(self, remotepath, fcallback, dcallback, ucallback, recurse=True):
      '''recursively descend, depth first, the directory tree rooted at
      remotepath, calling discreet callback functions for each regular file,
      directory and unknown file type.
  
      :param str remotepath:
          root of remote directory to descend, use '.' to start at
          :attr:`.pwd`
      :param callable fcallback:
          callback function to invoke for a regular file.
          (form: ``func(str)``)
      :param callable dcallback:
          callback function to invoke for a directory. (form: ``func(str)``)
      :param callable ucallback:
          callback function to invoke for an unknown file type.
          (form: ``func(str)``)
      :param bool recurse: *Default: True* - should it recurse
  
      :returns: None
  </code></pre>
  
  <p>But I am still confused on what exactly is meant by "callback function to invoke for a regular file, for a directory, and for an unknown file type.</p>
  
  <p>I have also looked through the official documentation:      <a href="https://media.readthedocs.org/pdf/pysftp/latest/pysftp.pdf" rel="noreferrer">https://media.readthedocs.org/pdf/pysftp/latest/pysftp.pdf</a></p>
  
  <p>but all it tells me about the <code>walktree()</code> function is that:</p>
  
  <blockquote>
    <p>Is a powerful method that can recursively (<em>default</em>) walk a <strong>remote</strong>
    directory structure  and calls a user-supplied callback functions for
    each file, directory or unknown entity it encounters.   It is used in
    the <code>get_x</code> methods of pysftp and can be used with great effect to do
    your own bidding.   Each callback is supplied the pathname of the
    entity. (form: <code>func(str)</code>)</p>
  </blockquote>
  
  <p>which I felt did not give me much information on how to call it properly.</p>
  
  <p>If someone could provide an example of calling this function correctly and an explanation of why you are passing your chosen arguments, it would be greatly appreciated!</p>