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\n", iRtn);

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

4、

5、

 

posted @ 2018-11-01 15:15  CppSkill  阅读(1057)  评论(0编辑  收藏  举报