// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <sys/stat.h>

#include <iostream>

using namespace std;

bool exist(char *filename)
{
   struct stat sb;
   return (stat(filename,&sb) == 0);
}

int main()
{
   cout << exist("stat.cpp") << endl;
   cout << exist("nostat.cpp") << endl;
   return 0;
}
