C check if file exists, including on PATH
- by Gary
Hi,
Given a filename in C, I want to determine whether this file exists and has execute permission on it. All I've got currently is:
if( access( filename, X_OK) != 0 ) {
But this wont search the PATH for files and will also match directories (which I don't want). Could anyone please help?