07 2012 档案

Andoid2.1--robotium<1>--NotePadTest
摘要:/* * This is an example test project created in Eclipse to test NotePad which is a sample * project located in AndroidSDK/samples/android-11/NotePad * Just click on File --> New --> Project --> Android Project --> Create Project from existing source and * select NotePad. * * Then you can 阅读全文

posted @ 2012-07-26 16:37 龙沙宝石 阅读(1172) 评论(0) 推荐(0)

uinx 学习(3)exec函数族 转载
摘要:进程控制函数之exec()函数的学习当我们看恐怖片时,经常会有这样的场景:当一个人被鬼上身后,这个人的身体表面上还和以前一样,但是他的灵魂和思想已经被这个鬼占有了,因此它会控制这个人做他自己想做的事情--那么在进程中也有这样的情景。那么是如何实现的呢?现在我们来学习exec()函数族一.exec()函数 族1. 首先我们在终端输入命令:man exec 可以看到函数的原型:#include <unistd.h>int execl(const char *path, const char *arg, ...);int execv(const char *path, char *con 阅读全文

posted @ 2012-07-16 19:54 龙沙宝石 阅读(947) 评论(0) 推荐(0)

unix学习笔记<2> 多线程 udp聊天程序 简单实例
摘要:1 /* client_udp.c: */ 2 #include <stdio.h> 3 #include <errno.h> 4 #include <sys/types.h> 5 #include <sys/socket.h> 6 #include <netinet/in.h> 7 #include <unistd.h> 8 #include <string.h> 9 10 #define MAX_BUF_SIZE 102411 struct sockaddr_in srvaddr,clientaddr;12 阅读全文

posted @ 2012-07-12 15:07 龙沙宝石 阅读(764) 评论(0) 推荐(0)

unix学习笔记<1> read () write()
摘要:摘自《unix环境高级编程》文件I/OSTDIN_FILENO--标准输入,一般指从键盘输入STDOUT_FILENO--标准输出,一般指输出到显示器STDERR_FILENO--标准出错输出定义函数:ssizet_t write (int fd, const *buf, size_t count)函数说明:write()会把参数buf所指的内存中的count个字节写到参数filedes所指的文件内中。返回值:成功write()会返回实际写入的字节数。当有错误发生时则返回-1,错误代码存入errno中。参数fd 可以是 STDIN_FILENO/文件,表头文件 #include<unis 阅读全文

posted @ 2012-07-09 11:23 龙沙宝石 阅读(3356) 评论(0) 推荐(1)

linux 学习之管道
摘要:#include "apue.h"#include <sys/wait.h>#define DEF_PAGER "/bin/more"int main (int argc, char *argv[]){int n;int fd[2];pid_t pid;char *pager, *argv0;char line[MAXLINE];FILE *fp;if (argc !=2)//命令行参数不为2时执行printf{printf("usage:a.out<pathmane>\n");}if ((fp = fopen 阅读全文

posted @ 2012-07-06 15:11 龙沙宝石 阅读(317) 评论(0) 推荐(0)

导航