Linux下 c 判断一个文件是否存在
#include <stdio.h>
#include <unistd.h>
#define FOO "foo"
int main(void)
{
if(!access(FOO, F_OK))
{
if(!unlink(FOO))
{
}
else
{
printf("remove %s failed\n", FOO);
}
}
else
{
printf("%s not existed\n", FOO);
}
return 0;
}
相关文档:
1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI) 就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......
例一:发送Signaling Packet:
Signaling Command是2个Bluetooth实体之间的L2CAP层命令传输。所以得Signaling Command使用CID 0x0001.
多个Command可以在一个C-frame(control frame)中发送。
如果要直接发送Signaling Command.需要建立SOCK_RAW类型的L2CAP连接Socket。这样才有机会自己填充Command Code,Identi ......
如何在linux下查看当前登录的用户,并且踢掉你认为应该踢掉的用户?
看了网络中的一些例子.在这里总结一下.主要用到的命令有,w,who,ps,kill,pkill
查看当前登录用户:
node8:/home # who
root :0 2009-11-04 16:26
root pts/0 &n ......
这是出席在2009年10月20日在东京举行的Linux内核大会合影照。全分辨率照片。一个女性都没有。你认识其中的几位呢?
以下是出席会议的名单,有兴趣的朋友可以对一对:
Al Viro
Alan Cox
Andi Kleen
Andrew Morton
Andy Whitcroft
Arjan van de Ven
Arnd Bergmann
Avi Kivity
Benjamin Herrenschmidt
Brian ......