Article 55BPK What is the best way to copy data from one FILE stream to another...

What is the best way to copy data from one FILE stream to another...

by
trist007
from LinuxQuestions.org on (#55BPK)
This is in C

I'm talking like a 300GB zip file, I was just using

Code:FILE *fp1, *fp2;
char c;

fp1 = fopen("/opt/test.zip", "rb");
fp2 = fopen("/home/user/dest.zip", "w+b");

c = fgetc(fp1);
while (c != EOF)
{
fputc(c, fp2);
c = fgetc(fp1);
}

fclose(fp1);
fclose(fp2);latest?d=yIl2AUoC8zA latest?i=BBs5vf3eJq4:nAeo3SobTR0:F7zBnMy latest?i=BBs5vf3eJq4:nAeo3SobTR0:V_sGLiP latest?d=qj6IDK7rITs latest?i=BBs5vf3eJq4:nAeo3SobTR0:gIN9vFwBBs5vf3eJq4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments