Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making the content list of files inside a Zip ?
#10
(02-06-2024, 05:04 PM)euklides Wrote: Thank's

And if you also want to know filesize:

    Do
        Get ff, , head
        If head.signature <> Chr$(&H50) + Chr$(&H4B) + Chr$(&H03) + Chr$(&H04) Then Exit Do
        fname = Space$(head.filenameLen)
        FX$ = Space$(head.uncompressedSize)
        Get ff, , fname
        If filecount > UBound(strarr) Then ReDim _Preserve strarr(filecount) As String
        strarr(filecount) = fname + "|" + _Trim$(Str$(Len(FX$)))
        filecount = filecount + 1
        Seek ff, Seek(ff) + head.extrafieldLen + head.compressedSize
    Loop Until EOF(ff)

And the program works with *.epub files  (that was my problem; epub are zip files)
Excellent addition.

A lot of file types are actually ZIP files in disguise. If the first two bytes of a file are 80 and 75 decimal, "PK", then the underlying data is more than likely a ZIP file in disguise.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
RE: Making the content list of files inside a Zip ? - by TerryRitchie - 02-06-2024, 05:38 PM



Users browsing this thread: 4 Guest(s)