def listdir_attr(self, path='<STR_LIT:.>'):
path = self._adjust_cwd(path)<EOL>self._log(DEBUG, '<STR_LIT>' % path)<EOL>t, msg = self._request(CMD_OPENDIR, path)<EOL>if t != CMD_HANDLE:<EOL><INDENT>raise SFTPError('<STR_LIT>')<EOL><DEDENT>handle = msg.get_string()<EOL>filelist = []<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>t, msg = self._request(CMD_READDIR, handle)<EOL><DEDENT>except EOFError as e:<EOL><INDENT>break<EOL><DEDENT>if t != CMD_NAME:<EOL><INDENT>raise SFTPError('<STR_LIT>')<EOL><DEDENT>count = msg.get_int()<EOL>for i in range(count):<EOL><INDENT>filename = _to_unicode(msg.get_string())<EOL>longname = _to_unicode(msg.get_string())<EOL>attr = SFTPAttributes._from_msg(msg, filename, longname)<EOL>if (filename != '<STR_LIT:.>') and (filename != '<STR_LIT:..>'):<EOL><INDENT>filelist.append(attr)<EOL><DEDENT><DEDENT><DEDENT>self._request(CMD_CLOSE, handle)<EOL>return filelist<EOL>
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