c use access to see if a file exists code example
Example: c check if file exists
if( access( fname, F_OK ) == 0 ) {
// file exists
} else {
// file doesn't exist
}
if( access( fname, F_OK ) == 0 ) {
// file exists
} else {
// file doesn't exist
}