易截截图软件、单文件、免安装、纯绿色、仅160KB

linux系统编程代码1

#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <time.h>
#include <unistd.h>
#define TIME_STRING_BUF 50
char * timestring(time_t t,char *buf)
 {
   struct tm *local;
local=localtime((&t);
strftime(buf,TIME_STRING_BUF,"%c",local);
return buf;
  }
 int statfile(const char * file)
{
 struct stat statbuf;
char timebuf[TIME_STRING_BUF];
if (lstat(file,%statbuf))
{
 fprintf(stderr,"could not lstat %s:%s\n",file,stderror(errno));
return 1;
}
 printf("filename : %s\n",file);
printf("on device : major %d/minor %d  inode number: %ld\n",major(statbuf.st_dev),minor(statbuf,st_dev),statbuf .st_ino)) )
printf("size     :%-10ld   type :  %07o     permissons  :%05o",statbuf,st_size,statbuf .st_mode&S_IFMT,statbuf  .st_mode&~(S_IFMT));
printf("ower   :%d      group    :%d  number  of  links  :%d\n",statbuf   .st_uid,statbuf    .st_uid,statbuf    .st_gid,statbuf   .stnlink);
printf("change time :%s\n",timeString(statbuf  ,st_ctime ,timeBuf));
printf("modified time :%s\n",timeString(statbuf  ,st_ctime ,timeBuf));
printf("access time :%s\n",timeString(statbuf  ,st_ctime ,timeBuf));
return 0;
 int
main(int argc,const char **argv)
{
   int i;
   int rc=0;
for (i=1;i<argv;i++)
{
    rc|=statFile(argv[i]);
    if((argc-i)>1)
    printf("\n");
  }
return rc;
}


相关文档:

实战Linux Bluetooth编程(六) 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 Bluetooth编程 (七) SDP协议

Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......

Linux 编译安装 MYSQL 5.1 与 Innodb

Linux 编译安装 MYSQL 5.1 与 Innodb
编译mysql5
代码:
./configure \
--prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
--with-extra-charsets=all \
--with-charset=utf8 \
- ......

Linux diff与patch的深入分析

Linux diff与patch的深入分析
http://blog.csdn.net/vrix/archive/2009/08/25/4483906.aspx
diff的输出格式分为传统格式和统一格式
1)diff的传统格式输出.
############################################
cat before.txt
输出:
This is a line to be deleted
This is a line that will be changed
This is a line ......

linux引导过程内幕


Linux 引导过程内幕
 
 
引导 Linux® 系统的过程包括很多阶段。不管您是引导一个标准的 x86 桌面系统,还是引导一台嵌入式的 PowerPC® 机器,很多流程都惊人地相似。本文将探索 Linux 的引导过程,从最初的引导到启动第一个用户空间应用程序。在本文介绍的过程中,您将学习到各种与引导有关的主题, ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号