aboutsummaryrefslogtreecommitdiff
path: root/common/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/file.h')
-rw-r--r--common/file.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/common/file.h b/common/file.h
new file mode 100644
index 0000000..5d875c9
--- /dev/null
+++ b/common/file.h
@@ -0,0 +1,19 @@
+#ifndef _UWU_COMMON_FILE_H_
+#define _UWU_COMMON_FILE_H_
+
+#include <stdio.h>
+#include <stdbool.h>
+
+inline static bool file_exists(const char *filename)
+{
+ FILE *f = fopen(filename, "r");
+
+ if (f) {
+ fclose(f);
+ return true;
+ }
+
+ return false;
+}
+
+#endif