您的位置:程序门 -> c/c++ -> c++ 语言



下面的目录打开为什么不行呀


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


下面的目录打开为什么不行呀
发表于:2007-01-12 10:15:01 楼主
#include   <io.h>
#include   <fcntl.h   >
#include   <sys\stat.h>

main()
{
        int   p   =   open( "c:\\11 ",o_rdonly   ,s_ifdir   );
        printf( "%d ",p);
        getch();
}
发表于:2007-01-12 10:58:581楼 得分:0
open是用来打开文件的,不是用来打开目录的。
发表于:2007-01-12 11:07:382楼 得分:0

name
              opendir   -   open   a   directory

synopsis
              #include   <sys/types.h>
              #include   <dirent.h>

              dir   *opendir(const   char   *name);
发表于:2007-01-12 12:45:463楼 得分:0
我是抄 < <the   c   language   program> > 上的代码
unix接口那章的
unix下目录也是文件呀
我的环境是xp
发表于:2007-01-12 12:49:324楼 得分:0
unix接口那章的
unix下目录也是文件呀
我的环境是xp
-----------------------------------------------------------------------------------
你不觉得矛盾么?


快速检索

最新资讯
热门点击