def listdir_attr(self, path="<STR_LIT:.>"):
path = self._adjust_cwd(path)<EOL>self._log(DEBUG, "<STR_LIT>".format(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_binary()<EOL>filelist = []<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>t, msg = self._request(CMD_READDIR, handle)<EOL><DEDENT>except EOFError:<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 = msg.get_text()<EOL>longname = msg.get_text()<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 `.SFTPAttributes` objects corresponding to
files in the given ``path``.  The list is in arbitrary order.  It does
not include the special entries ``'.'`` and ``'..'`` even if they are
present in the folder.

The returned `.SFTPAttributes` objects will each have an additional
field: ``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 str path: path to list (defaults to ``'.'``)
:return: list of `.SFTPAttributes` objects

.. versionadded:: 1.2