import os
def list_directory_recursively(directory):
paths = []
for root, dirs, files in os.walk(directory):
for name in files:
paths.append(os.path.join(root, name))
for name in dirs:
paths.append(os.path.join(root, name))
return paths