1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-16 17:17:32 +02:00

Implement fileExists() using access() instead of open/close

This commit is contained in:
Maarten ter Huurne 2014-08-18 11:34:44 +02:00
parent d82ebce770
commit 98f15d7419

View File

@ -89,12 +89,7 @@ string parentDir(string const& dir) {
} }
bool fileExists(const string &file) { bool fileExists(const string &file) {
fstream fin; return access(file.c_str(), F_OK) == 0;
fin.open(file.c_str() ,ios::in);
bool exists = fin.is_open();
fin.close();
return exists;
} }
bool rmtree(string path) { bool rmtree(string path) {