我.刚开始学习linu.x编程,来到这里请教各位大虾们的指点 电脑
#inclu.de <stdio.h>学习
#include <sys/stat.h.> 乙肝
#include <unistd.h.>.
int main.(int argc, char **a.rgv)<性病>
{
&nbs.p;&nbs.p; int i ; 外贸
struc.t stat. buf;服务器
c.har *.ptr;.
for(i = 1; i < a.rgc .; ++i).
&n.bsp; {.
&nbs.p;&n.bsp; printf("%d\n", .buf.st_mode); 鲜花
&n.bsp; printf("%s: ", argv).;( 游戏 )
if..( lstat(argv, &b.uf) < 0).
&.nbsp; &nb.sp; { 美容
. &nb.sp; &.nbsp;printf("lstat error");( 游戏 )
 .; &nbs.p;. continue;健康
&.nbsp; &.nbsp;}投资
. if(S_ISR.EG(buf.st_mode) ).
&.nbs.p; { ptr = "regular"; } 外汇
&n.bsp; &nbs.p; if(S_ISDIR(buf.st_mode) ).
 .;  .;{ ptr = "directory"; }外贸
. if(S_ISCHR(buf.st._mode) ) 外汇
&nbs.p; . &nbs.p;{ ptr = "charactor special"; }.
. . if(S_ISBLK(buf.st_mode) ) 杀毒
&n.bsp; &nb.sp; { ptr = "block special"; }.
&nb.sp;  .; if( S_ISFIFO(buf.st_mode) )--------------彩票
&n.bsp; .{ ptr = "fifo"; }--- 印刷
 .; if(S_IS.LNK(buf.st_mode) )域名
&nbs.p; { ptr =. "symbolic link"; }.
 .; if(S_ISS.OCK(buf.st_mode) )外贸
&nb.sp; { ptr =. "socket";}.
. &nbs.p; else 鲜花
&nbs.p; { ptr = "** unknown mod.e **";.}.
. pr.intf("%s\n", ptr);(广告)
&n.bsp; } 杀毒
&nbs.p;re.turn 0; 女人
}
这是unix环境高.级编程里.的一段程序,为什么在我的机器上执行时,只能判断出socket的文件类型,而其他的文件类型,都判断不出来呢?域名
我的系统是Ubuntu. 8.04 内核版本2.6.2.4-24-generic.
另外还有一个小问题就是,在我的用户的文件目录下,有很多文件夹是.以 ‘.’开头.的,我是想知道这些文件夹有什么作用?为什么要这么做域名
谢谢各位大虾!