smitha Posted December 18, 2005 Share Posted December 18, 2005 How can I copy a tar file into another file say xyz using a C program in windows/DOS environment Link to comment Share on other sites More sharing options...
mattst88 Posted December 21, 2005 Share Posted December 21, 2005 (edited) 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);}fclose(tar);fclose(new);That's really off the top of my head, virtually no error checking. Edited December 21, 2005 by mattst88 Link to comment Share on other sites More sharing options...
LLXX Posted December 22, 2005 Share Posted December 22, 2005 Why not just invoke a cmd shell with the appropriate command? No need to write your own copier... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now