Hi, I have found a weird issue with fopen on my machine (win7 64bit, not sure about other platforms). I have found that it refuses to open one particular file on my HD. I tried renaming it and moving it, but to no avail. Weirdly, another file of the same format in the same directory will open fine. Swapping the names of these files does not help, fopen still knows which one it can't open. I also tried changing the mode argument to "w", this results in the original file being overwritten with an empty file. errno does not seem to get set when it fails. Can anyone suggest any reason why this might happen?
No idea about the reason, but see if you can use CreateFile() to open this file successfully. If the call fails, call GetLastError() and FormatMessage() to obtain error information.