mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 13:05:20 +02:00
Implement fileExists() using access() instead of open/close
This commit is contained in:
parent
d82ebce770
commit
98f15d7419
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user