#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
int main(int argc, char **argv)
{
printf("Usage: %s <src> <dst>\n", argv[0]);
exit(1);
}
// 利用open函数打开文件,并返回文件描述符
int fd1 = open(argv[1], O_RDONLY);
</
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
int main(int argc, char **argv)
{
//判断参数个数是否正确
if(argc != 3){
printf("Usage: %s <src> <dst>\n", argv[0]);
exit(1);
}
// 利用open函数打开文件,并返回文件描述符
int fd1 = open(argv[1], O_RDONLY);
</