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

linux下大文件读写源码示例

#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
int main()
{
printf("sizeof(off_t) = %d\n", sizeof(off_t));
int fd = 0;
#if 1
fd = open("/root/test", O_WRONLY | O_CREAT | O_LARGEFILE, 0600);
#else
fd = open("/dev/hda1", O_RDONLY, 0600);
#endif
if (fd > 0)
{
off_t l = 0x200000001LL;
off_t l_new = lseek(fd, l, SEEK_SET);
if (l_new < 0)
printf("l_new =%d\n", l_new);
#if 1
else
write(fd, &fd, sizeof(fd));
#endif
printf("l_new = 0x%.16x\n", l_new);
close(fd);
}
struct stat st;
int ret = stat( "/root/test", &st);
printf( "\n%d--%I64u-\n", ret, st.st_size );
}


相关文档:

Linux 下 将PDF文件中的文本,图片导出的方法。


PDF格式文件中的文本是可以导出来再修改的。
同样,PDF里面的插图也是可以提取出来的。
PDF转纯文本:
pdftotext -enc GBK godson2e-data.Sheet.pdf text.GBK.txt
-enc (encoding)
要参照/etc/xpdf/xpdfrc 里面提到的编码格式。对于中文,用GBK
就可以了。
提取插图:
pdfimages godson2e-data.Sheet.pdf img
该 ......

Linux 内核中的 GCC 特性(转)


Linux 内核中的 GCC 特性(转)
了解用于 C 语言的 GCC 扩展
文档选项
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt=&qu ......

灵活使用Linux下的glimpse工具和tee命令


采用glimpse可以对源代码进行索引,这样在繁杂的代码里面,可以很快的找到关键字。
这个工具就是glimpse。使用方法就不多说了。可以查google嘛! ^__^
采用tee命令可以将glimpse查找出来的信息转存为文件。
就是这样:
    glimpse CONFIG_BOOTDELAY | tee bootdelay.txt
这样就查出了所有CONFI ......

linux下tcp服务器源码示例

#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <s ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号