Chinaunix首页 | 论坛 | 博客
  • 博客访问: 448731
  • 博文数量: 179
  • 博客积分: 3236
  • 博客等级: 中校
  • 技术积分: 1860
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-25 19:13
文章分类

全部博文(179)

文章存档

2011年(34)

2008年(8)

2007年(27)

2006年(110)

分类: 嵌入式

2011-05-05 11:57:05

1.create file on floopy disk and write contents:
-> pdev=fdDevCreate(0,0,0,0)     /* A:,1.44M,whole disk,offset */
-> dosFsMkfs("/fd0",pdev)  
-> fd=creat("/fd0/myfile",2)  or   -> fp=fopen("/fd0/myfile","w")
-> buf="what you want to write to file" 
-> write(fd,buf,strlen(buf)+1)  or -> fprintf(fp,buf)
-> close(fd)    or  -> fclose(fp)

2.open file and read contents from floopy disk:
-> readbuf=malloc(100)   
-> fd=open("/fd0/myfile",2)  or -> fp=fopen("/fd0/myfile","r")
-> read(fd,readbuf,100)   or -> fread(readbuf,1,50,fp)
-> printf readbuf   
-> close(fd)    or -> close(fp)
      

3.on simpc shell:
-> fp=fopen("host:d:/temp/myfile","w")
-> fprintf(fp,"kjkkhjk")
-> fclose(fp)


阅读(3202) | 评论(0) | 转发(0) |
0

上一篇:贪吃蛇游戏源码

下一篇:2440 test 之ADC

给主人留下些什么吧!~~