//文件夾是否存在
BOOL MakeSureDirectoryPathExists(
PCSTRDirPath
);
or
CString folder=" href_cetemp="">DirPath
);
or
CString folder="C:\\eaxmple";
CFileFind finder;
if (finder.FindFile(folder)==FALSE)
{
CreateDirectory(folder,NULL);
}
finder.Close();
or
CFile file;
if (!file.Open("....", CFile::modeRead))
file.Open("...", CFile::modeCreate);
路徑函數里有
//檢測路徑是否是一個文件夾
BOOL PathIsDirectory( LPCTSTR pszPath
);
//檢測空文件夾
BOOL PathIsDirectoryEmpty( LPCTSTR pszPath
);
//創建文件夾
BOOL CreateDirectory(
LPCTSTR lpPathName,
LPSECURITY_ATTRIBUTES lpPathName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes);
int_mkdir(
constchar*dirname
);
//移除文件夾
BOOLRemoveDirectory(
LPCTSTRdirname
);
//移除文件夾
BOOLRemoveDirectory(
LPCTSTRlpPathName);
int_rmdir(
constchar*dirname
);
posted on 2007-01-13 22:58
我風 閱讀(318)
評論(0) 編輯 收藏 引用