1.系统I/O实现复制命令(cp src dest)
#include<stdio.h>
#include<string.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<getch.h>
int main(int argc,char** argv)
{
if(3 != argc)
{
puts("格式错误,示例:cp src dest");
return -1;
}
//打开源文件
int src_fd = open(argv[1],O_RDONLY);
if(src_