//文件夹是否存在
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
我风 阅读(308)
评论(0) 编辑 收藏 引用