how to check if a file exist c linux 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
}