0
FILE *file = NULL;
errno_t err = 0;
err = fopen(&file, "test.txt", "ab+");

Now I need to know if test.txt already existed & opened or just newly created. It's because I have to do something only if it is a newly created but do nothing when it is an existing one.

Is this possible?

HaeRim Lee
  • 53
  • 6

1 Answers1

0

before your fopen you can check if it exists: answer found there on StackOverflow

Xavier B.
  • 533
  • 2
  • 9