I want to determine if a folder contains a file, when both are specified by a path.
At first glance this seems simple. Just check if the file path starts with the directory path. However, this naive check ignores several issues:
- Paths may be relative or absolute
- Paths may use the alternate directory separator
- Paths may use inconsistent casing, which matters depending on the OS
- Different paths may refer to the same location
- Probably some more that I don't know about
Is there an existing method in the framework, or do I have to write my own?