项目开发日报表 姓名:王成凯 日期:2018.10.8
项目名称 | 嵌入式Linux应用 |
---|---|
本人进度计划以及任务 | 熟练掌握C语言编写及一些基本知识,Linux的基本语言, |
本日任务完成情况 | 完成的较好 |
本日开发中出现的问题汇总 | 括号冒号漏打,打错字,应用可能还不熟练 |
本日未解决问题 | 目前没有 |
本日开发收获 | 巩固了上次所学和C语言方面知识,学会了man查找creat,open,write,read相关的编写 |
自我评价 | 上课进度基本跟的上,还算较为认真 |
同组其他成员评价 | 无 |
其他 | #include <stdio.h> |
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int fd,ret;
char buf1[32]= “1234567890”;
char buf2[32]={0};
fd=open("h.txt",O_RDWR | O_CREAT,00700);
if(-1 == fd)
{
perror ("open");
exit(1);
}
ret = write(fd,buf1,strlen(buf1));
if (-1 == ret)
{
perror("write");
exit(1);
}
lseek(fd,0,SEEK_SET);
ret = read(fd,buf2,sizeof(buf2));
if (-1 ==ret)
{
perror("read");
exit(1);
}
printf("%s\n",buf2);
close(fd);
return 0;
} |
| | |
|