Hey
I'm currently writing a web server for windows. I have managed to get the file requested from the browser, but I'm not sure how to go about checking if it exists.
If they request something like www.site.com/news, I need to check if '/news' is a folder, or a file. I figured if theres a / after news, like "/news/" then I'll look for a folder first, otherwise if theres no '/' at the end I'll check for a file first. If theres no file, then I'll look for a folder.
I figured I'll try FindFirst/FindNext for this, and I've found numerous examples on how to do it, so I don't need any help there.
But I was wondering if there was other functions (parhaps that aren't platform specific) that could also do the job?
All I need to do is something like this
Code:if (file string has '/') { open as a folder and index files. if not found report 404 file not found } else { look for a file by the name, if we cant find it look for a folder. if not found report 404 file not found }