1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 07:02:29 +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) {
fstream fin;
fin.open(file.c_str() ,ios::in);
bool exists = fin.is_open();
fin.close();
return exists;
return access(file.c_str(), F_OK) == 0;
}
bool rmtree(string path) {