I basically want to open a file and read but also make changes to it in binary, if it exists, and I want the file to be created if it doesn't. Thus, 'ab+'. No issues there.
However, I essentially want to see if the file existed before it was created by 'ab+', since if it didn't, then there is no need to read in the contents (we can be guaranteed it is empty). Basically a lengthy part of the code could then be skipped over, if I make it as if only the file existed prior to it being created by the fopen 'w' or 'a' modes. However it seems wasteful to try (succeeding most of the time too) and open a file in read mode each time, close it, and open the same file again in append binary mode.
It's honestly not a major issue. Just curious. Is a more convenient way possible? I'm on a windows platform using MSVisio.