CopyFile("in.dat","out.dat")
CopyFile(Source,Destination) // copy file from source to destination
{
// open source and destination files
src = fopen(Source,"rb");
if ( src == NULL )
Fatal("Could not open source file /"%s/" for reading.",Source);
dest = fopen(Destination,"wb");
if ( dest == NULL )
Fatal("Could not open file /"%s/" for writing.",Destination);
// read chunks from source, and copy to destination
#define COPY_CHUNK_SIZE 500
i=0;
while (( 0 != (size = fread(buf,COPY_CHUNK_SIZE,src)) )&&(i<50))
{
i++;
fwrite(buf,size,dest);
}
// close the files
fclose(dest);
fclose(src);
}
我是用C--写的,麻烦你自己改成C语言。