def lsl(hdfs_path, user=None, recursive=False):
host, port, path_ = path.split(hdfs_path, user)<EOL>fs = hdfs(host, port, user)<EOL>if not recursive:<EOL><INDENT>dir_list = fs.list_directory(path_)<EOL><DEDENT>else:<EOL><INDENT>treewalk = fs.walk(path_)<EOL>top = next(treewalk)<EOL>if top['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>dir_list = list(treewalk)<EOL><DEDENT>else:<EOL><INDENT>dir_list = [top]<EOL><DEDENT><DEDENT>fs.close()<EOL>return dir_list<EOL>
Return a list of dictionaries of file properties.

If ``hdfs_path`` is a file, there is only one item corresponding to
the file itself; if it is a directory and ``recursive`` is
:obj:`False`, each list item corresponds to a file or directory
contained by it; if it is a directory and ``recursive`` is
:obj:`True`, the list contains one item for every file or directory
in the tree rooted at ``hdfs_path``.