上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
  2012年9月4日
摘要: 上次使用strtok来取硬盘分区信息,感觉这个函数很好用。今天发现有bug,详见:http://www.cnblogs.com/hoys/archive/2011/09/19/2180999.html然后发现了strtok_r,写了个学习例子。代码如下: 1 /* 2 * Author : jevan 3 * Date : 2012.09.04 4 * Filename : strsep.c 5 */ 6 #include <stdlib.h> 7 #include <stdio.h> 8 #include <string.h> 9 10 int main( 阅读全文
posted @ 2012-09-04 15:54 J.evan 阅读(248) 评论(0) 推荐(0) 编辑
  2012年8月31日
摘要: 主要参考:http://www.linuxforum.net/forum/showflat.php?Cat=&Board=linuxK&Number=288776&fpart=allhttp://www.linuxforum.net/forum/showflat.php?Cat=&Board=linuxK&Number=69203&page=&view=&sb=&o=&vc=1我暂时改成了我需要的(这还不是我的最终需求): 1 /* by hugang at 6/8 9:40 */ 2 /* mod by jeva 阅读全文
posted @ 2012-08-31 12:00 J.evan 阅读(1277) 评论(0) 推荐(0) 编辑
  2012年8月30日
摘要: 1 #include <fcntl.h> 2 #include <string.h> 3 #include <assert.h> 4 #include <pthread.h> 5 #include <unistd.h> 6 #include <stdlib.h> 7 #include <sys/stat.h> 8 #include <sys/time.h> 9 #include <errno.h> 10 #include <stdio.h> 11 #include <l 阅读全文
posted @ 2012-08-30 15:23 J.evan 阅读(362) 评论(0) 推荐(0) 编辑
  2012年8月29日
摘要: 1 #使用ufsd通用分区格式来挂载ntfs分区2 mount -t ufsd /dev/sda5 /opt/ 为啥能使用ufsd来挂载NTFS分区呢???找到一篇文章:TP_UFSD_Data_Sheet.doc文章大概内容如下:波尔冈 通用文件系统驱动 UFSD 数据手册近年来,由于市面上各种操作系统和版本的流行,我们日常接触到的文件系统也变得越来越多样化了。我们这里提及的“文件系统”就是我们通常所说的磁盘格式。它是操作系统非常重要的一部分。所有文件的存储,管理和处理都离不开它。操作系统要依靠它来在硬盘上寻找、读取和使用所存储的文件。每种文件系统都有它自己的特点,而通常在推出一个新的操作系 阅读全文
posted @ 2012-08-29 16:31 J.evan 阅读(1370) 评论(0) 推荐(0) 编辑
摘要: 主引导记录(Master Boot Record,缩写:MBR),又叫做主引导扇区,是计算机开机后访问硬盘时所必须要读取的首个扇区,它在硬盘上的三维地址为(柱面,磁头,扇区)=(0,0,1)。详情:http://zh.wikipedia.org/wiki/%E4%B8%BB%E5%BC%95%E5%AF%BC%E8%AE%B0%E5%BD%95首先使用shell如何查看MBR信息:1 #使用dd导出MBR到mbr.bin文件2 dd if=/dev/sda of=mbr.bin bs=512 count=1 3 #使用dd导出MBR并且使用xxd显示4 dd if=/dev/sda bs=51 阅读全文
posted @ 2012-08-29 14:03 J.evan 阅读(1184) 评论(0) 推荐(0) 编辑
  2012年8月24日
摘要: 1#include<fcntl.h>2#include<stdlib.h>3#include<errno.h>4#include<sys/stat.h>5#include<sys/types.h>6#include<string.h>7#include<unistd.h>8#include<stdio.h>9#include<assert.h>1011//level:12//0:majorprint,callpath13//1:moredetailedprint14//2:mostdet 阅读全文
posted @ 2012-08-24 17:06 J.evan 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 删除字符串中多余的空格,这个代码很烂,将就吧。1voiddel_multi_space(char*src)2{3if(!src)return;45intsrc_len=strlen(src);6char*dest=(char*)malloc(src_len+1);7memset(dest,0,src_len+1);89inti,j=0;10for(i=0;i<src_len;i++)11{12if(!((src[i]==32)&&(src[i+1]==32)))13dest[j++]=src[i];1415}16dest[j]='\0';17memset( 阅读全文
posted @ 2012-08-24 16:36 J.evan 阅读(158) 评论(0) 推荐(0) 编辑
  2012年8月21日
摘要: 抄自:http://baike.baidu.com/view/1983936.htm直接修改了编码和删除dos.h头文件,使其能在linux下运行。1#include<stdio.h>2#include<time.h>3intmain(void){4time_tt;5structtm*area;6t=time(NULL);7area=localtime(&t);8printf("Numberofsecondssince1/1/1970is:%ld\n",t);9printf("Localtimeis:%s",asctime 阅读全文
posted @ 2012-08-21 14:06 J.evan 阅读(297) 评论(0) 推荐(0) 编辑
  2012年8月16日
摘要: 这个错误出现在开发板中,文件系统为ext3 无ulimit 解决方案有2种:方案一 :limit1#include<sys/time.h>2#include<sys/resource.h>3intmodify_limit()4{5structrlimitlimitf;6if(getrlimit(RLIMIT_CORE,&limitf)==0){7printf("limitf.rlim_cur=0x%x,limitf.rlim_max=0x%x\n",limitf.rlim_cur,limitf.rlim_max);8limitf.rlim_c 阅读全文
posted @ 2012-08-16 12:28 J.evan 阅读(1723) 评论(0) 推荐(0) 编辑
  2012年8月10日
摘要: 命令下的mount使用时带各种参数,我在写c代码时却不知道参数加在什么地方,查了下资料,自己再做个记录:命令行:1mount-oiocharset=gb2312/dev/sdb1/mnt对应的c:1rest=mount(devPath,mntPath,"vfat",S_WRITE,"iocharset=gb2312");2//如果有多个options,以“,”分开 阅读全文
posted @ 2012-08-10 16:53 J.evan 阅读(487) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页