I have a program that uses a simple text file for data.
When the program runs, I want it to check and see if the data file is present in the same folder. If not, I want to create it. If the data file already exists I don't want the program overwriting the existing file.
In Qbasic I did this by opening the file as Append, immediately closing it and then opening the file as Input.
When attempting to do this in C, I get a compile error where I attempt to close the "open as Append" command.
I'm certain the open/close command is correct, because I'm able to write data to the file after opening it as Append (and this also removes the compile error).
I assume this ain't nuthin' but a C thing. I don't want to do anything to the file when I open it as Append, so how can I close it quickly and quietly without modifying the file?
Or is there a better way to do this?