From b622a7ac42fd8d67320a2267e03cf7fe77d81f55 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 31 Mar 2021 12:14:23 +0200 Subject: [PATCH] added file_exists function --- util.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util.cpp b/util.cpp index 356275df..702357ac 100644 --- a/util.cpp +++ b/util.cpp @@ -699,4 +699,8 @@ EX string decompress_string(string s) { } #endif +EX bool file_exists(string fname) { + return access(fname.c_str(), F_OK) != -1; + } + }