generated from AfonsoCMSousa/CPP-Template
Added file IO operations, and argument parcing
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#include "files.h"
|
||||
|
||||
u_char file_exists(const char *filename) {
|
||||
FILE *file = fopen(filename, "r");
|
||||
if (file) {
|
||||
fclose(file);
|
||||
return 1; // File exists
|
||||
}
|
||||
return 0; // File does not exist
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef FILES__H_INCLUDED
|
||||
#define FILES__H_INCLUDED
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
u_char file_exists(const char *filename);
|
||||
|
||||
#endif // FILES__H_INCLUDED
|
||||
Reference in New Issue
Block a user