Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

copying a tar file in a C(MS Dos/Windows) program

Recommended Posts

FILE *tar;
FILE *new;
char buffer[4096];

tar = fopen("mytarfile.tar", rb);
new = fopen("mynewfile.tar", w+b);
while ( !feof(tar) ) {
fread(buffer, 1, 4094, tar);
fwrite(buffer, 1, 4094, new);

That's really off the top of my head, virtually no error checking.

Edited by mattst88
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...