我有如下基本代码,
fd = open("test.file", O_RDONLY);
if (read(fd, &tempch, 1) < 1) {
perror("File Read Error");
exit(1);
}
printf("We could read from the file\n");
Run Code Online (Sandbox Code Playgroud)
test.file存在于文件系统中,并已获得777权限.程序抛出错误"文件读取错误:成功"...任何人都可以说出可能的原因吗?谢谢
| 归档时间: |
|
| 查看次数: |
8456 次 |
| 最近记录: |