I get input from a user for a global wildcard something like this
C:\some folder\*.txt
I use glob on this to look for all files ending with .txt (in this example). The problem I have is, I would like to check the directory before I look for the file. What I mean is let's say there were no .txt files in C:\some folder but C:\some folder exists, I want to say there are no files in some folder that have *.txt
However if the user entered
C:\some folders\*.txt and that folder does not exist (note the s) then I want to say the directory some folders does not exist. Any ideas on how. One last thing, I can't use dirname() on it because if a user enters C:\some folder\another folder\ with nothing then dirname returns
C:\some folder and I would like C:\some folder \another folder to be returned.
I now there are some methods I can use here I just don't remember which ones. Thanks,