-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
central functions for managing files
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
|
||
FILE *load_file(char *file_stream_name, char *mode) | ||
{ | ||
FILE *f_stream = fopen(file_stream_name, mode); | ||
|
||
if (f_stream == NULL) | ||
{ | ||
fprintf(stderr, "Failed to access file '%s'\n", file_stream_name); | ||
exit(EXIT_FAILURE); | ||
} | ||
|
||
return f_stream; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef FILES_H | ||
#define FILES_H | ||
|
||
FILE *load_file(char *file_stream_name, char *mode); | ||
|
||
#endif |