# Traverse the filesystem push to stack / while currentdirectory = pop stack open the currentdirectory foreach pathname in this directory if it's also a directory, push it (full path) on the stack close the current directory #### call traverse(/) function traverse (currentdirectory) open currentdirectory foreach pathname in this directory if it's also a directory, traverse(pathname) close currentdirectory