vc判断文件是否存在

#include  
#include  
#include  

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" );
   }
}

 

转载于:https://www.cnblogs.com/tiandsp/p/7440789.html

你可能感兴趣的:(vc判断文件是否存在)