1

I know that when I compress an archive with the 7za utility, it gives me stats like the number of files processed and the amount of bytes processed (the original size of the data).

Is it possible, using the commandline (on linux) or some programming language, to determine:

  • the original size of an archive, before it was compressed?
  • the number of files/directories contained within an archive?

The answer might be "no, just decompress the whole archive and do counting/sizing then", but it would be useful to know if there was a faster/less space-greedy way.

2 Answers 2

3

You could pipe the output from 7za l <path to archive> into a text file or directly into a program written in the programming language of your choice.

0
0

Well I dont know if it works with 7za. But you can estimate a Tar size before you created the Tar file with this command.

$ tar -cf - /directory/to/archive/ | wc -c

Source: http://www.thegeekstuff.com/2010/04/unix-tar-command-examples/

1
  • Thanks, but I was hoping for a method that doesn't require me to perform operations when the archive is being created. I want to be able to determine the filecount/estimated size if I just have an archive, and no knowledge of how/when/where it was made.
    – Zac B
    Jul 5, 2012 at 13:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .