Traverse directory and count file type