2012-01-16

How to check file with C++

It is really easy.


int value = access("file.txt", 0);

if(value == 0)
    cout << "It is a file" << endl;
else if(value == -1)
    cout << "It is not a file" << endl;

No comments:

Post a Comment