Recent

Author Topic: Zipper: TZipFileEntry size incorrect for large files  (Read 3336 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Zipper: TZipFileEntry size incorrect for large files
« on: June 06, 2014, 03:25:09 pm »
I'm not sure where to report this "bug", so my apologies if this is the wrong place ...

I've been playing with the zipper unit, which uses TZipFileEntry.
One of the properties (for each file in the zip file) of TZipFileEntry  is "Size" (integer) which indicates the size of a given entry.
For large files however, this seems to return the wrong value (-1).

I'm running Lazarus 1.2.2, fpc 2.6.4, under MacOS X 10.9.3 (intel), with a zip file created on the command line (zip -9 myzip.zip data.bin), where the zipped file (data.bin) is 8 Gb.
Note: Command-line tools under MacOS X like zipinfo and unzip seem incompatible with files this "large" as well.

Any suggestions or ideas how to fix this or alternative ways to determine the size of large zipped files (in the zip) would be very welcome :) ...

p.s. I did read this post, but it did not seem to fix the problem.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Zipper: TZipFileEntry size incorrect for large files
« Reply #1 on: June 06, 2014, 03:28:08 pm »
In 2.6.4, there is AFAIR no support for the zip64 format yet. zip64 supports large files.

In trunk (currently 2.7.1), there is support for zip64 but tzipper uses streams which are limited to 2gb IIRC; size reporting may be better but extraction will probably fail...
The post you linked to discusses the implementation in trunk.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Zipper: TZipFileEntry size incorrect for large files
« Reply #2 on: June 06, 2014, 03:34:22 pm »
Actually, this
http://bugs.freepascal.org/view.php?id=23533
is more interesting: you can see my patch was included in FPC 2.7.1 (which means it's not in 2.6.x unless it was backported... and AFAIR it wasn't)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Zipper: TZipFileEntry size incorrect for large files
« Reply #3 on: June 06, 2014, 03:58:12 pm »
Thank you for the very fast reply BigChimp ...!  :)


I'm not sure how to use FPC 2.7.1 ... I did look for it a few times now (i.e. VLC support seems to need 2.7.1 as well).
I guess I'll just be patient until 2.7.1 becomes mainstream.


I did notice however that "zipdetails" (MaOS X command line) does give the proper size. Not exactly perfect, but it will have to do for now until Zip64 is supported under Lazarus.


For unzipping I'll use "funzip" (also MacOS X command line).

 

TinyPortal © 2005-2018