标签:
一:在C语言中关于文件的操作
二:在UNIX中关于文件的操作
int fd = open("a.txt",O_RDONLY|O_CREAT|O_TUEN,0666);
if (fd == -1)perror("open"),exit(-1);
write(fd,"hello",5);
close(fd);
int buff[10];
int res = read(fd,buff,sizeof(buff));
printf("res=%d,buff=%s\r\n",res,buff); //res = 5,buff = hello;
标签:
原文地址:http://www.cnblogs.com/cliuwei/p/4664802.html