c语言怎么复制整个文件夹

在当前目录下

第1个回答  推荐于2018-03-29
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main()
{
int fdSrc;
int fdDst;
fdSrc=open("./test.txt",O_RDONLY);
fdDst=open("./test2.txt",O_WRONLY);
char buff[1024];
int ref;
do
{
ref=read(fdSrc,buff,1024);
printf("%s\n",buff);
write(fdDst,buff,ref);
}while(ref==1024);
}本回答被网友采纳
第2个回答  2014-03-16
文件复制可以通过一个简单的IO读写完成,文件夹的话应该是要调用windows的API来创建一个文件夹后把再把文件复制过去。这个你要去查看windows的API了。
第3个回答  2014-03-16
相似回答