fn that generates a tree of the current working directory & prints to a file