# 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