aboutsummaryrefslogtreecommitdiff
path: root/common/file.h
blob: c5e8036be799e34d48917ec4317d6bb8ed4ee598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef _COMMON_FILE_H_
#define _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