Concatenate tar files windows




















Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. I have been concatenating them in the past by looping through each of the archives I see on the file system and doing something like this. The problem with this however is that as I concatenate more and more tar files, it must read to the end of allTars.

Sometimes it takes over 20 minutes to start adding another tar file. It is just too slow and I am missing an agreed upon delivery time of the complete allTars. This gave very odd results. This may not help you, but if you are willing to use the -i option when extracting from the final archive, then you can simply cat the tars together.

A tar file ends with a header full of nulls and more null padding till the end of the record. With --concatenate tar must go through all the headers to find the exact position of the final header, in order to start overwriting there. If you just cat the tars, you just have extra nulls between headers.

The -i option asks tar to ignore these nulls between headers. So you can. Also, your tar --concatenate example ought to be working. However, if you have the same named file in several tar archives you will rewrite that file several times when you extract all from the resulting tar. This question is rather old but I wish it had been easier for myself to find the following information sooner.

So if anyone else stumbles across this, enjoy:. What Jeff describes above is a known bug in gnu tar reported in August Only the first archive the one after the -f option gets its EOF marker removed. If you try to concatenate more than 2 archives the last archive s will be "hidden" behind file-end-markers. It is a bug in tar. It concatenates entire archives, including trailing zero blocks, so by default reading the resulting archive stops after the first concatenation. Considering the age of the bug I wonder if it will ever get fixed.

I doubt there is a critical mass that is affected. The best way to circumvent this bug could be to use the -i option, at least for. As Jeff points out tar --concatenate can take a long time to reach the EOF before it concatenates the next archive. So if you're going to be stuck with a "broken" archive that needs the tar -i option to untar, I suggest the following:. Instead of using tar --concatenate -f archive1. Also note that this could lead to unexpected behaviour if the tapes did not get zeroed before over writing new data onto them.

For that reason the approach I am going to take in my application is nested tars as suggested in the comments below the question. Using -so to write to standard output always leads to the mention "not implemented". Cyan: There's a developer API and library designed for use in your own code, I imagine that'd be smaller yet, and much easier to use than building command lines and capturing standard output from a child process.

Cyan: A little bit of it, yes. I was building a. NET assembly based on that Unfortunately, although i can download and compile the source code "as is", producing an equivalent binary as the one proposed, there is no way for me to dig into the myriad of source files to find the proper function i need which is just about concatenation.

Community Bot 1 1 1 silver badge. Ben Voigt Ben Voigt k 38 38 gold badges silver badges bronze badges. Yes, indeed. COPY concatenate file content directly, with no other information. So retrieving original files names, size, etc. A solution is still to be found Here is the link to shar for those who interested.

Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Helping communities build their own LTE networks. Podcast Making Agile work for data science. For details, consult the tar manual page ; on the command line, enter:.

You can access this documentation by entering:. This is document acfi in the Knowledge Base. Last modified on Skip to: content search login. Knowledge Base Toggle local menu Menus About the team. Knowledge Base Search.

Log in.



0コメント

  • 1000 / 1000