I know that it does in PHP, and I’m pretty sure it does in Java. I haven’t used the latest versions of .NET, so I won’t speak for them. It seems very awkward, but I was wondering if there was an underlying reason for this.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One reason is compatibility – anyone who has done ‘check for existence’ knows to exclude directories; changing that behaviour may confuse those who rely on that behaviour.
Secondly, the underlying code often does a check on the operating system for existence in a catlog of filesystem entries – to the OS, a directory is the same as a file. In other words, it’s looking for an entry of ‘xyz’ in the catalog not a file with name ‘xyz’ in the catalog.
Backwards compatability is the main reason, I suspect.