code: def listdir_attr(self, path='.'):
          
          path = self._adjust_cwd(path)
          self._log(DEBUG, 'listdir(%r)' % path)
          t, msg = self._request(CMD_OPENDIR, path)
          if t != CMD_HANDLE:
              raise SFTPError('Expected handle')
          handle = msg.get_string()
          filelist = []
          while True:
              try:
                  t, msg = self._request(CMD_READDIR, handle)
              except EOFError, e:
                  # done with handle
                  break
              if t != CMD_NAME:
                  raise SFTPError('Expected name response')
              count = msg.get_int()
              for i in range(count):
                  filename = _to_unicode(msg.get_string())
                  longname = _to_unicode(msg.get_string())
                  attr = SFTPAttributes._from_msg(msg, filename, longname)
                  if (filename != '.') and (filename != '..'):
                      filelist.append(attr)
          self._request(CMD_CLOSE, handle)
          return filelist
docs: Return a list containing L{SFTPAttributes} objects corresponding to
          files in the given C{path}.  The list is in arbitrary order.  It does
          not include the special entries C{'.'} and C{'..'} even if they are
          present in the folder.
  
          The returned L{SFTPAttributes} objects will each have an additional
          field: C{longname}, which may contain a formatted string of the file's
          attributes, in unix format.  The content of this string will probably
          depend on the SFTP server implementation.
  
          @param path: path to list (defaults to C{'.'})
          @type path: str
          @return: list of attributes
          @rtype: list of L{SFTPAttributes}
  
          @since: 1.2