检查干嘛,
直接 mkdir("c:\aaa");
就行了。

解决方案 »

  1.   

    用 FindFirstFile(),然后用CreateDirectory()
      

  2.   

    直接 CreateDirectory 吧,如果目录存在,CreateDirectory 会失败。
      

  3.   

    if (GetFileAttribute(path) & FILE_ATTRIBUTE_DIRECTORY) //is directoryGetFileAttributes(dir)
    如果函数的返回值为0XFFFFFFFF,则表明目录不存在if(CFile::GetStatus(path,CFileStatus &fs))
    PathFileExists
    Determines whether a path to a file system object such as a file or directory is valid. BOOL PathFileExists(
        LPCTSTR pszPath
        );Parameters
    pszPath 
    Full path of the object to verify. 
    Return Values
    Returns TRUE if the file exists, or FALSE otherwise. Call GetLastError for extended error information.
    Res
    This function tests the validity of the path. It works only on the local file system or on a remote drive that has been mounted to a drive letter. It will return FALSE for remote file paths that begin with the UNC names \\server or \\server\share. It will also return FALSE if a mounted remote drive is out of service. Requirements 
      Version 4.71 and later of Shlwapi.dll  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 4.0 or later). 
      Windows 95/98/Me: Requires Windows 98 (or Windows 95 with Internet Explorer 4.0 or later). 
      Header: Declared in Shlwapi.h. 
      Import Library: Shlwapi.lib
      

  4.   

    MakeSureDirectoryPathExists
    The MakeSureDirectoryPathExists function creates all the directories in the specified DirPath, beginning with the root.BOOL MakeSureDirectoryPathExists(
      PCSTR DirPath  
    );
      

  5.   

    agreen to the  LLnju(LLnju)'s view!如果失败得话,你不处理,系统会忽略得!