#include
int main(int argc, char *argv[])
{
if (argc != 2)
if (access(argv[1], R_OK) < 0)
err_ret("access error for %s", argv[1]);
else
printf("read access OK\n");
if (open(argv[1], O_RDONLY) < 0)
err_ret("open error for %s", argv[1]);
else
printf("open for read OK\n");
return 0;
}
阅读(784) | 评论(1) | 转发(0) |