new file_handling method

This commit is contained in:
gandc committed 2025-02-27 20:29:21 +03:00
1 parent f329180197
commit cb20bd27b4
2 files changed
+16

No files matched your search

+11
View File
@@ -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;
}
+5
View 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