...
| Code Block | ||
|---|---|---|
| ||
char *file_name; FILE *f_ptrfp; /* initialize file_name */ f_ptrfp = fopen(file_name, "w"); if (f_ptrfp == NULL) { /* Handle Error */ } /*... Process file ...*/ if (fclose(f_ptrfp) != 0) { /* Handle Error */ } if (remove(file_name) != 0) { /* Handle Error */ } |
...
| Code Block | ||
|---|---|---|
| ||
char *file_name; FILE *f_ptrfp; /* initialize file_name */ if (!secure_dir(pathfile_name)) { /* Handle Error */ } f_ptrfp = fopen(file_name, "w"); if (f_ptrfp == NULL) { /* Handle Error */ } /*... Process file ...*/ if (fclose(f_ptrfp) != 0) { /* Handle Error */ } if (remove(file_name) != 0) { /* Handle Error */ } |
...