如题目所示,如何在程序中判断某个路径是否存在?

解决方案 »

  1.   

    int _access( const char *path, int mode );int _waccess( const wchar_t *path, int mode );pathFile or directory pathmodePermission settingmode Value    Checks File For 
    00            Existence only 
    02            Write permission 
    04            Read permission 
    06            Read and write permission 
      

  2.   

    Return ValueEach of these functions returns 0 if the file has the given mode. The function returns –1 if the named file does not exist or is not accessible in the given mode; in this case, errno is set as follows:EACCESAccess denied: file’s permission setting does not allow specified access.ENOENTFilename or path not found.