From e84c60f48aecc60d7289882d53b687920d223ef8 Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 26 Oct 2014 08:47:24 +0100 Subject: fixed bug that hasposter is only true if poster really exists --- libcore/helpers.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libcore/helpers.c') diff --git a/libcore/helpers.c b/libcore/helpers.c index 1934f3e..4ca2272 100644 --- a/libcore/helpers.c +++ b/libcore/helpers.c @@ -90,6 +90,11 @@ bool isNumber(const string& s) { return !s.empty() && it == s.end(); } +bool FileExists(const string &fullpath) { + struct stat buffer; + return (stat (fullpath.c_str(), &buffer) == 0); +} + bool FileExists(const string &path, const string &name, const string &ext) { stringstream fileName; fileName << path << name << "." << ext; -- cgit v1.2.3