new file_handling method
This commit is contained in:
2 files changed
+16
No files matched your search
@@ -0,0 +1,11 @@
|
||||
#include "file_handling.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
FILE *open_file(const char *path, const char *mode, const char *error_message) {
|
||||
FILE *file = fopen(path, mode);
|
||||
if (!file) {
|
||||
perror(error_message);
|
||||
}
|
||||
return file;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#ifndef FILE_HANDLING_H
|
||||
#define FILE_HANDLING_H
|
||||
#include <stdio.h>
|
||||
FILE *open_file(const char *path, const char *mode, const char *error_message);
|
||||
#endif
|
||||
Reference in new issue
Block a user