#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
int main(int argc,char *argv[])
{
char buff[100]="hello world!";
int fd=open(argv[1],O_RDWR,0666);
if(fd==-1) printf("打开文件失败\n");
int ret=write(fd,buff,100);
printf("实际写入:%d\n",ret);
close(fd);
return 0;
}