vc判断文件是否存在
#include <io.h> #include <stdio.h> #include <stdlib.h> void main( void ) { /* Check for existence */ if( (_access( "D:\\a.txt", 0 )) != -1 ) { printf( "File ACCESS.C exists\n" ); /* Check for write permission */ if( (_access( "ACCESS.C", 2 )) != -1 ) printf( "File ACCESS.C has write permission\n" ); } }