09 2011 档案
摘要:1.安装准备(1) 下载sqlite-3.6.16.tar.gz软件包(2) 执行tar zxvf sqlite-3.6.16.tar.gz解压缩(3) 确保arm-linux交叉编译链能正常使用2 安装x86版本cd sqlite-3.6.16./configuremakemake install安装完成后,执行sqlite3 test.db进行测试。3 安装arm版本(重新解压一份)cd sqlite-3.6.16./configure --host=arm-linux --prefix=/usr/local/sqlitemakemake install注:--prefix指定安装目录【移
阅读全文
摘要:首先编译安装sqlite x86和arm版本,参见【搭建sqlite嵌入式开发环境】(1) x86版gcc -o login.cgi -L/usr/local/lib/ -I/usr/local/include/ -static login.c -lsqlite3 -lpthread(2) arm版arm-linux-gcc -o login.cgi -L/usr/local/sqlite/lib/ -I/usr/local/sqlite/include/ -static login.c -lsqlite3 -lpthread
阅读全文
摘要:1【方法1】(1) 设置cookieprintf( "Set-Cookie:username=%s; path=/; \r\n ",username);printf("Content-type: text/html\n\n");注意:设置cookie的语句要放在Content-type前,否则不能生效。(2) 查看cookieprintf("Content-type: text/html\n\n");printf("<html>\n"); info=getenv("HTTP_COOKIE&qu
阅读全文
摘要:(1) vi bundle.sh#! /bin/bash#bundle :group files into distribution packageecho "# To unbundle, bash this file"for ido echo "echo $i 1>&2" echo "cat >$i <<'End of $i'" cat $i echo "End of $i"done(2) cat h1.txthello1hello2cat h2.txthello3
阅读全文
摘要:一、 设计目的通过Linux C编程,设计一个基于TCP/IP的文件传输系统,实现网络文件的收发。二、 设计环境VMware WorkStation 6.0.2+Fedora 10三、 设计方案(1)文件读写任意文件都可以二进制的方式进行读写,为了实现任意文件类型的传输,在读写文件的过程中,必须采用二进制的读写方式。(2)传输协议 为了保证数据的正确性,文件传输需要采用一种可靠的传输协议。UDP协议实现比较简单,但UDP面向无连接,传输过程中,会出现丢包的情况,导致数据发送失败。故采用面向连接的TCP/IP协议,防止传输过程中的数据丢失的情况。(3)大文件的传输对于比较大的文件,应该进行分包操
阅读全文
摘要:1.. 设计目的设计一个串口程序,该程序执行时,具有通信参数选择及串口收发数据功能,界面友好。2 设计流程图及说明 如图1.1所示,程序运行后,首先进入功能选择,共4中功能可供选择,分别为接收数据,发送数据,接收文件,发送文件。根据提示,键入不同的数字,可以进入不同的功能。设置完毕,进入参数设置,可以保持默认参数,也可以设置用户参数,若设置有误,还可以对参数重新设置。参数设置确认后,打开串口。若串口打开无误,则根据用户的选择进入不同的功能。图1.1 总体设计流程图3 设计测试3.1 测试环境及步骤测试环境:VMware WorkStation 6.0.2+Fedora 10+minicom+广
阅读全文
摘要:#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include <fcntl.h>#include <time.h>#include <errno.h>int main(void){int fd,retval;char buf[6];fd_set readfds,tmp_readfds;struct timeval tv;if((fd=open("/dev/input/mice",O
阅读全文
摘要:/********************************************************** * This program is use to copy src_file to dest_file * 1 Execute gcc -o copy copy.c * 2 then, copy the execute file "copy" to the /usr/bin * You can use command like this : copy src_file dest_file * Author : Tan De * Time : 2011-04
阅读全文
浙公网安备 33010602011771号