...
Code Block | ||
---|---|---|
| ||
/* program code */ const char *old = "oldfile.ext"; const char *new = "newfile.ext"; FILE *file = fopen(new, "r"); if (!file != NULL) { fclose(file); if (rename(old, new) != 0) { /* Handle remove failure */ } } else { fclose(file); /* handle error condition */ } /* program code */ |
...