#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<assert.h>
#include<string.h>
#include<fcntl.h>
int main()
{
int fd =open("a.txt",O_RDONLY);//读出文件内容
assert( fd != -1);
char buff[128]={0};
int n=read(fd ,buff ,127);
printf("buff=%s,n=%d\n",buff ,n);
close(fd);
/*
int fd=open("a.txt",O_WRONLY | O_CREAT , 0600);//写入内容
assert( fd != -1);
write(fd,"hello",5);
close(fd);
*/
}
~