Uncompressed file estimation wrong?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I had a large (~60G) compressed file (tar.gz).



I used split to break it into 4 parts and then cat to join them back together.



However, now, when I am trying to estimate the size of the uncompressed file, it turns out it is smaller than the original? How is this possible?



$ gzip -l myfile.tar.gz 
compressed uncompressed ratio uncompressed_name
60680003101 3985780736 -1422.4% myfile.tar









share|improve this question

























    up vote
    1
    down vote

    favorite












    I had a large (~60G) compressed file (tar.gz).



    I used split to break it into 4 parts and then cat to join them back together.



    However, now, when I am trying to estimate the size of the uncompressed file, it turns out it is smaller than the original? How is this possible?



    $ gzip -l myfile.tar.gz 
    compressed uncompressed ratio uncompressed_name
    60680003101 3985780736 -1422.4% myfile.tar









    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I had a large (~60G) compressed file (tar.gz).



      I used split to break it into 4 parts and then cat to join them back together.



      However, now, when I am trying to estimate the size of the uncompressed file, it turns out it is smaller than the original? How is this possible?



      $ gzip -l myfile.tar.gz 
      compressed uncompressed ratio uncompressed_name
      60680003101 3985780736 -1422.4% myfile.tar









      share|improve this question













      I had a large (~60G) compressed file (tar.gz).



      I used split to break it into 4 parts and then cat to join them back together.



      However, now, when I am trying to estimate the size of the uncompressed file, it turns out it is smaller than the original? How is this possible?



      $ gzip -l myfile.tar.gz 
      compressed uncompressed ratio uncompressed_name
      60680003101 3985780736 -1422.4% myfile.tar






      tar compression split






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      pkaramol

      345112




      345112




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          This is caused by the size of the field used to store the uncompressed size in gzipped files: it’s only 32 bits, so gzip can only store sizes of files up to 4 GiB. Anything larger is compressed and uncompressed correctly, but gzip -l gives an incorrect uncompressed size.



          So splitting the tarball and reconstructing it hasn’t caused this, and shouldn’t have affected the file — if you want to make sure, you can check it with gzip -tv.



          See Fastest way of working out uncompressed size of large GZIPPED file for more details, and the gzip manual:




          The gzip format represents the input size modulo 2³², so the uncompressed size and compression ratio are listed incorrectly for uncompressed files 4 GiB and larger.







          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f472013%2funcompressed-file-estimation-wrong%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            4
            down vote



            accepted










            This is caused by the size of the field used to store the uncompressed size in gzipped files: it’s only 32 bits, so gzip can only store sizes of files up to 4 GiB. Anything larger is compressed and uncompressed correctly, but gzip -l gives an incorrect uncompressed size.



            So splitting the tarball and reconstructing it hasn’t caused this, and shouldn’t have affected the file — if you want to make sure, you can check it with gzip -tv.



            See Fastest way of working out uncompressed size of large GZIPPED file for more details, and the gzip manual:




            The gzip format represents the input size modulo 2³², so the uncompressed size and compression ratio are listed incorrectly for uncompressed files 4 GiB and larger.







            share|improve this answer


























              up vote
              4
              down vote



              accepted










              This is caused by the size of the field used to store the uncompressed size in gzipped files: it’s only 32 bits, so gzip can only store sizes of files up to 4 GiB. Anything larger is compressed and uncompressed correctly, but gzip -l gives an incorrect uncompressed size.



              So splitting the tarball and reconstructing it hasn’t caused this, and shouldn’t have affected the file — if you want to make sure, you can check it with gzip -tv.



              See Fastest way of working out uncompressed size of large GZIPPED file for more details, and the gzip manual:




              The gzip format represents the input size modulo 2³², so the uncompressed size and compression ratio are listed incorrectly for uncompressed files 4 GiB and larger.







              share|improve this answer
























                up vote
                4
                down vote



                accepted







                up vote
                4
                down vote



                accepted






                This is caused by the size of the field used to store the uncompressed size in gzipped files: it’s only 32 bits, so gzip can only store sizes of files up to 4 GiB. Anything larger is compressed and uncompressed correctly, but gzip -l gives an incorrect uncompressed size.



                So splitting the tarball and reconstructing it hasn’t caused this, and shouldn’t have affected the file — if you want to make sure, you can check it with gzip -tv.



                See Fastest way of working out uncompressed size of large GZIPPED file for more details, and the gzip manual:




                The gzip format represents the input size modulo 2³², so the uncompressed size and compression ratio are listed incorrectly for uncompressed files 4 GiB and larger.







                share|improve this answer














                This is caused by the size of the field used to store the uncompressed size in gzipped files: it’s only 32 bits, so gzip can only store sizes of files up to 4 GiB. Anything larger is compressed and uncompressed correctly, but gzip -l gives an incorrect uncompressed size.



                So splitting the tarball and reconstructing it hasn’t caused this, and shouldn’t have affected the file — if you want to make sure, you can check it with gzip -tv.



                See Fastest way of working out uncompressed size of large GZIPPED file for more details, and the gzip manual:




                The gzip format represents the input size modulo 2³², so the uncompressed size and compression ratio are listed incorrectly for uncompressed files 4 GiB and larger.








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 47 mins ago

























                answered 56 mins ago









                Stephen Kitt

                147k22321389




                147k22321389



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f472013%2funcompressed-file-estimation-wrong%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    Confectionery