用open函数打开一个文件。比如:
09 char *file = "/home/temp/hello.c ";
10
11 int fd;
12
13 if((fd = open(file, O_RDONLY)) < 0)
14 {
15 printf("open error\n");
16 return -1;
17 }
因为hello.c后边有个空格,导致打开错误,去掉后就正常了!!
有奖活动 | |
---|---|
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
【有奖活动】智能可穿戴设备AR/VR如何引领科技新潮流! | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
【有奖活动】震撼来袭!这场直播将直击工程师的心灵! |