This is my code for recursively traversing a directory's sub-directories and files. The problem is that it works on the first pass, but on the second call, the directory check will fail. I've checked to make sure it's identifying files vs folders correctly, which it is. It's also not failing to open the directories, so I don't get why it would fail to recognize them, and call the function again. I'd really like to stick to this method if possible instead of using other libraries.