系统代码中有一个ERROR_PATH_NOT_FOUND,但没找到判断路径是否存在的函数

解决方案 »

  1.   

    SetCurrentDirectory是否成功,成功则存在该目录,否则不存在
      

  2.   

    msdn里有个函数:
    DWORD GetFileAttributes(
      LPCTSTR lpFileName   // pointer to the name of a file or directory
    );说是可以;
    但如果在目录下创建一个文件test,而不是,调用
    GetFileAttributes("test");dw = GetLastError();返回成功,既是说它分不清"test"是目录还是文件?
      

  3.   

    ERROR_PATH_NOT_FOUND是GetLastError函数返回值的一种,通常用于象GetFileAttributes,OpenFile之类的函数由于无法找到操作的文件产生的错误信息。
      

  4.   

    FindFirstFile
    The FindFirstFile function searches a directory for a file whose name matches the specified file name. FindFirstFile examines subdirectory names as well as file names.Mailto:[email protected]