You can use the stat() function to check if an object is a file or directory, like this. My issue is, <sys/stat.h> isn't on Windows, and I'm not sure what the Windows equivalent or Windows function is. This question is how do I do this, but specifically in a cross platform manner.
While avoiding conditionally compiled code, how can I cross platform check if an object at a path is a file or a directory in C? Although there's an almost identical question, it cannot help me as it's unanswered, and the author is deleted so the question cannot be maintained.
To my understanding fopen() is cross platform, and so is opendir(), readdir(), scandir() etc, so why wouldn't simply checking if an object is a file or directory be cross plaform? If there is no way, and conditionally compiled code is the only way, how do I do it in Windows?