I try to use the fopen API for file IO as much as possible for portability. Typically if a file can't be opened I don't need to know why. However in some cases, for example when multiple programs read and write to the same file, I need to know if the file is simply locked for reading or writing, as opposed to it failing for some other reason (like the path is invalid, or the drive is full, etc).
With CreateFile and GetLastError I can determine exactly why I couldn't open the file.
Is there such a method with fopen? Or do I have to use a non-portable API to get that extra info?
Dan East