Skip to content

Commit

Permalink
Merge pull request #7 from misonyo/master
Browse files Browse the repository at this point in the history
修改读写提示信息位置
  • Loading branch information
yqiu2018 authored Nov 7, 2018
2 parents 63e3df9 + 0d77bed commit 4c990a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions readwrite_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,19 @@ static void readwrite_sample(void)
{
write(fd, s, sizeof(s));
close(fd);
rt_kprintf("Write done.\n");
}

rt_kprintf("Write done.\n");

/* 以只读模式打开 /text.txt 文件 */
fd = open("/text.txt", O_RDONLY);
if (fd >= 0)
{
size = read(fd, buffer, sizeof(buffer));
close(fd);
rt_kprintf("Read from file test.txt : %s \n", buffer);
if (size < 0)
return ;
}

rt_kprintf("Read from file test.txt : %s \n", buffer);
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(readwrite_sample, readwrite sample);

0 comments on commit 4c990a4

Please sign in to comment.