Re: [cpp] c语言如何判断一个路径是文件还是文件夹

sunpluto sunpluto2004 at yahoo.com.cn
Wed Oct 31 10:18:39 CST 2007


据我所知,_stat 函数是检测最快的,应该有 C 标准形态,具体参见 MSDN
   
  要么使用 FindFirstFile 也可以,具体参见 MSDN

李辉 <xylophone21 at gmail.com> 写道:
          hff = _findfirst( root, &fileinfo );
        if( hff > 0 )
        {
            printf("Searching files in %s ...\n",root_dir);
            do
            {
                if(fileinfo.attrib & _A_ARCH)
                {
                       .....
                }
            }while( -1 != _findnext(hff,&fileinfo) );

            _findclose( hff );
        }


  在07-10-28,Shuo Chen <giantchen at gmail.com> 写道:  GetFileAttributes()

On 10/28/07, hit_pc <hit_pc at 163.com> wrote:
> cpp:
>     就是类似于python中的``isdir''函数,找了半天都没有找到.
> 操作系统是xp,不能使用``S_ISDIR''. 
>
>>>
> lichao
> 20071028
>
> --
> //-------------------------
> 毫无疑问,
> 我写的code,
> 是全世界,
>  最鲁棒的。
> _______________________________________________ 
> Cpp mailing list
> Cpp at codingnow.com
> http://codingnow.com/mailman/listinfo/cpp
>
>

_______________________________________________ 
Cpp mailing list
Cpp at codingnow.com
http://codingnow.com/mailman/listinfo/cpp




-- 
同洲 李辉
Tel:0755-26733800-6035(工作时间)/ 0755-26520073(下班时间)
Email:xylophone21 at gmail.com(常用)
MSN:xylophone21 at 163.com(工作时间在线)
GTalk:xylophone21 at gmail.com(工作时间在线)
手机:失窃中&# 8230;请使用以上联系方式 _______________________________________________
Cpp mailing list
Cpp at codingnow.com
http://codingnow.com/mailman/listinfo/cpp



致
礼
       
---------------------------------
雅虎邮箱,终生伙伴! 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codingnow.com/pipermail/cpp/attachments/20071031/102a97ad/attachment.html


More information about the Cpp mailing list