C/C++.文件是否存在

1、

2、_access, _waccess.html(https://msdn.microsoft.com/en-us/library/1w06ktdy.aspx

int _access(   
   const char *path,   
   int mode   
); 

    

3、测试代码:

#include <direct.h> //_mkdir函数的头文件
#include <io.h>     //_access函数的头文件

#include <stdio.h>
#include <windows.h>


    int iRtn = _access("D:\G_DR_2018\_G2SVG_Console_VS08\LOG", 0);
    printf("_access return : %d
", iRtn);

  成功返回 0,失败返回 -1

4、

5、

原文地址:https://www.cnblogs.com/cppskill/p/9889433.html