如何判断某个文件夹是否存在? 我想写个程序,来判断某个文件夹是否存在,请大家帮助我吧,我的email是[email protected],qq是79110201,请大家帮助我1下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 int ValidatePathname(LPCTSTR lpszPathname){ struct _stat buf; int result = _wstat( lpszPathname, &buf ); if( result == 0 ) { if ( (buf.st_mode & _S_IFDIR) == _S_IFDIR ) { // it's folder return TYPE_FOLDER; } else if ( (buf.st_mode & _S_IFREG) == _S_IFREG ) { // it's file return TYPE_FILE; } } return TYPE_NULL;} CreateDirectory就行了,如果存在就返回错误 想在本地运行html5,可有什么方法? 【100分请教IE8编程】IE8下面怎么创建工具栏上面的按钮 vc编程问题,为什么析构函数能显示两次呢 请高手推荐好用图表控件(急求) 请赐教!怎样排除VC++编译和运行时的错误. 如何在CEditView 或CRichEditView中实现 ,关键字识别 八问高手!!! 如何利用ado备份sql内的数据库 VS2010里的GetCurSel() vc2005如何包含头文件 狂散100分:MSDN和VC的冲突——绝望中,高手帮忙!!! 郁闷中,散分。。。。。。
{
struct _stat buf;
int result = _wstat( lpszPathname, &buf );
if( result == 0 )
{
if ( (buf.st_mode & _S_IFDIR) == _S_IFDIR )
{
// it's folder
return TYPE_FOLDER;
}
else if ( (buf.st_mode & _S_IFREG) == _S_IFREG )
{
// it's file
return TYPE_FILE;
}
}
return TYPE_NULL;
}