finding a PNG picture in a zip file.

I am looking for an example code of finding all ( template_thumbnail.png ) pictures in all zip,rar files in a Directory and all its sub Directorys.

I just need to browse to a Directory and look for (template_thumbnail.png) in all the rar/zip files in that directory and all its sub directorys.

Note: Some zip , rar files will have multiple zip/rar files in them that contain a (template_thumbnail.png).
LVL 12
Grant1842Asked:
Who is Participating?
 
Grant1842Connect With a Mentor Author Commented:
well i am trying zipforge component. The code works just to point to 1 zip file and display its contents.
I need to point to a directory and find all the files and sub directorys(subfiles) that have the template_thumbnail.png in them.
Can someone help me with this code.
procedure TfmMain.bnStartClick(Sender: TObject);
var   ArchiveItem: TZFArchiveItem;
      ListItem: 	 TListItem;
      FileDate:    Integer;
begin
 ListView.Items.Clear;
 with Archiver do
    begin
          FileName := 'D:TEMPLETS\1.5.X\template.zip';
        // Open existing archive file
        OpenArchive(fmOpenRead);


        // Search text files stored inside the archive
        if (FindFirst('*.*',ArchiveItem,faAnyFile-faDirectory)) then
           repeat
    	      // Add file name
    	      ListItem := ListView.Items.Add;
    	      ListItem.Caption := ArchiveItem.FileName;

    	      // Add modification date
            FileDate := ArchiveItem.LastModFileDate shl 16 +
                        ArchiveItem.LastModFileTime;
    	      ListItem.SubItems.Add(DateToStr(
    	            FileDateToDateTime(FileDate)));

    	      // Add file size
    	      ListItem.SubItems.Add(IntToStr(ArchiveItem.UncompressedSize));

    	      // Add compression rate
    	      ListItem.SubItems.Add(Format('%f',[ArchiveItem.CompressionRate])+' %');

    	      // Add compressed file size
    	      ListItem.SubItems.Add(IntToStr(ArchiveItem.CompressedSize));

    	      // Add file path
    	      ListItem.SubItems.Add(ArchiveItem.StoredPath);
            until (not FindNext(ArchiveItem));

            // Close the archive
            CloseArchive;
    end;
end;

Open in new window

0
 
vdh_techCommented:
Maybe you can use the integrated windows search functions, and an iFILTER (http://www.ifilter.org/)

Windows Search 4.0 might also be a consideration.  You're going to want to index the location and then search it.
0
 
Grant1842Author Commented:
Anyone have any thoughts here ?
THX
0
 
CodedKCommented:
Hi Grant1842,
ZipTV supports RAR files, and can search files in RAR/ZIP.

http://www.ziptv.com/
0
 
Grant1842Author Commented:
THanks for this i will look at it
0
All Courses

From novice to tech pro — start learning today.