#include <stdio.h> #include <io.h> int file_exists ( char *filename ); int main ( void ) { printf ( "Does NOTEXIST.FIL exist: %s\n", file_exists ( "NOTEXISTS.FIL" ) ? "YES" : "NO" ); return 0; } int file_exists ( char *filename ) { return ( access ( filename, 0 ) == 0 ); }