Recursive preorder directory traverse implemented