摘要: fseek( fd, 8192 , SEEK_SET); /* 跳转至数据段 */ //开始解压数据; int size,n; char image_name[32]=""; for( i=0; i < imagecount ; i++ ){ size = images[i].imagesize; /* 获取镜像的大小 */ unsigned char buffer[size]; /* 创建缓冲区 */ strncpy(image_name,i... 阅读全文
posted @ 2013-03-27 12:12 scue 阅读(284) 评论(0) 推荐(0) 编辑
摘要: struct tm *ptr; time_t lt; unsigned int times=<秒数时间变量>; char str[80]; lt=times; ptr=localtime(&lt); strftime(str,100,"%F %X",ptr);摘抄来的,来源忘记了。。。 阅读全文
posted @ 2013-03-27 07:39 scue 阅读(2792) 评论(1) 推荐(0) 编辑
摘要: #define BUFFER_SIZE 1024//合并文件mergeFile (infile1, infile2, filenmae)void mergeFile(FILE *fp1,FILE *fp2,char *name){ FILE *fd1,*fd2,*fp3; unsigned char buf[BUFFER_SIZE]; char filename[100]; strncpy(filename,name,sizeof(filename)); int rc1,rc2; fd1 = fopen(fp1,"rb"); fd2 = fopen(f... 阅读全文
posted @ 2013-03-27 07:35 scue 阅读(3004) 评论(0) 推荐(0) 编辑
摘要: 珍藏...#define BUFFER_SIZE 1024//在尾部补零void appendZeros(FILE *fp, int size){ FILE *fd; unsigned int buffer[size]; strncpy(buffer,"",sizeof(buffer)); if ( ( fd=fopen(fp,"a+") ) == NULL ){ printf ( "在补零时,打开目标文件失败!\n" ); exit(1); } if ( size != 0 ){ fwrite(buffer, 1 ... 阅读全文
posted @ 2013-03-27 00:57 scue 阅读(803) 评论(0) 推荐(0) 编辑