判斷當前目錄下是否存在文件?
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
void main( void )
{
/* Check for existence */
if( (_ACCESS( "ACCESS.C", 0 )) != -1 )
{
printf( "File ACCESS.C exists " );
/* Check for write permission */
if( (_access( "ACCESS.C", 2 )) != -1 )
printf( "File ACCESS.C has write permission " );
希望對你有用,謝謝了
}
}