文件夹的拷贝

#include

      //    rename("/home/sll/123.txt","/home/sll/abc.txt");
          FILE *fd=fopen("/home/sll/abc.txt","a");
          for(int i<63;i<63+26;i++){
                fput(i ,fd);
          }
          int c;
          fd=fopen("/home/sll/abc.txt","r");
          while((c=fgetc(fd))!=EOF){
              printf("%c",c);
         }
               fclose(fd);
    
return 0;
}



#include
#include
int main(){
        FILE *fd1=fopen("a.txt","r");
        FILE *fd2=fopen("b.txt","w");
        int max=16;
        char *buf=malloc(max);
        size_t len;
        while((len=fread(buf,1,max,fd1))!=0){
            fwrite(buf,1,len,fd2);    
        }
          fclose(fd1);
          fclose(fd2);

return 0;
}






你可能感兴趣的:(文件夹的拷贝)