Use Array.to_list when listing a directory.