#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
using namespace std;
bool ArqExiste(string Arquivo)
{
ifstream verificacao (Arquivo.c_str());
if(verificacao.is_open())
{
verificacao.close();
return true;
}
else
{
verificacao.close();
return false;
}
}
int main()
{
string file = "C:\\Temp\\aipflib.log";
printf("%b", ArqExiste(file));
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmJvb2wgQXJxRXhpc3RlKHN0cmluZyBBcnF1aXZvKQp7CiAgICBpZnN0cmVhbSB2ZXJpZmljYWNhbyAoQXJxdWl2by5jX3N0cigpKTsKICAgIGlmKHZlcmlmaWNhY2FvLmlzX29wZW4oKSkKICAgIHsKICAgICAgICB2ZXJpZmljYWNhby5jbG9zZSgpOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQogICAgZWxzZQogICAgewogICAgICAgIHZlcmlmaWNhY2FvLmNsb3NlKCk7CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQp9CgppbnQgbWFpbigpCnsKICAgIHN0cmluZyBmaWxlID0gIkM6XFxUZW1wXFxhaXBmbGliLmxvZyI7CgogICAgcHJpbnRmKCIlYiIsIEFycUV4aXN0ZShmaWxlKSk7Cn0=