Well the code I provided does not have that issue and it checks for a folder not a file.

His method will find (if working) either file or folder by that name.

But I guess he didn't want to try my version.