error_handling
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
#include "error_handling.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
FILE *open_error_file(const char *path) {
|
||||||
|
FILE *file = fopen(path, "w");
|
||||||
|
if (!file) {
|
||||||
|
fprintf(stderr, "Error: Cannot open error file %s\n", path);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return file;
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#ifndef ERROR_HANDLING_H
|
||||||
|
#define ERROR_HANDLING_H
|
||||||
|
#include <stdio.h>
|
||||||
|
FILE *open_error_file(const char *path);
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user