home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / PARADIS1 / ZIPHEAD.PAS < prev   
Pascal/Delphi Source File  |  1992-03-26  |  2KB  |  68 lines

  1. (4843)  Sat 21 Mar 92 14:57
  2. By: Joy Mukherjee
  3. To: Stevo Wierengo
  4. Re: View Zip file contents
  5. St:
  6. ---------------------------------------------------------------------------
  7. @MSGID: 1:387/255 75b82377
  8. SW>Does anybody have any routines to view zip file contents.
  9.  
  10. SW>Stev0
  11.  
  12. procedure ViewZip (ZIPFile : String);
  13.  
  14. const
  15.     Sig = $04034B50;
  16.  
  17. type
  18.     ZFHeader = record
  19.         Signature : LongInt;
  20.         Version,
  21.         GPBFlag,
  22.         Compress,
  23.         Date,
  24.         Time        : Word;
  25.         CRC32,
  26.         CSize,
  27.         USize       : LongInt;
  28.         FNameLen,
  29.         ExtraField  : Word;
  30.       end;
  31.  
  32.  
  33. var
  34.     Hdr : ^ZFHeader;
  35.     F   : File;
  36.     S   : String;
  37.  
  38. begin
  39.     {Open ZIP file, get all Files from that zip, close ZIP }
  40.  
  41.     New (Hdr);
  42.     Assign (F, ZIPFile);
  43.     Reset (F, 1);
  44.     repeat
  45.         FillChar (S, SizeOf (S), #0);
  46.         BlockRead (F, Hdr^, SizeOf (ZFHeader));
  47.         BlockRead (F, Mem [Seg (S) : Ofs (S) + 1], Hdr^.FNameLen);
  48.         S [0] := Chr (Hdr^.FNameLen);
  49.         If (Hdr^.Signature = Sig) then Writeln (S);
  50.         Seek (F, FilePos (F) + Hdr^.CSize + Hdr^.ExtraField);
  51.     until Hdr^.Signature <> Sig;
  52.     Close (F);
  53.     Dispose (Hdr);
  54. end;
  55.  
  56. This was kind of copied / keyed in from another program of mine, but it
  57. should work OK.  Let me know if you need more help.  I also have an ARJ
  58. one if you choose to add it to your BBS, although I think its similar to
  59. LZH...
  60.  
  61.  
  62.  * SLMR 2.1a # * This tagline stolen by Silly Little Mail Reader!
  63.  
  64. --- MsgToss 2.0c! (r)
  65.  * Origin: Nul 512-615-NUL1 HST/V32b,615-NUL2, NUL3, 1.2Gig (1:387/255)
  66.  
  67. @PATH: 387/255 823 170/400 512/0 1007 
  68.