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) {
|
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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user