How show progress during ReadHeader at Packer Plugins?

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
mas912
Junior Member
Junior Member
Posts: 6
Joined: 2012-03-15, 10:52 UTC

How show progress during ReadHeader at Packer Plugins?

Post by *mas912 »

Subj.

I have large archives and reading of archive header takes lot of time (5+ seconds). I want to notify TC about reading progress or something like to prevent UI freezing.

Calling ProcessDataProc during ProcessFile(PK_SKIP) seems do nothing.

Any other way?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, no progress bar is supported while just reading headers, this would be very confusing for the user. I would have to handle this myself, e.g. by showing a dialog after 5 seconds or so. So far I didn't have any plugins that slow. Where can I find a slow plugin to test this?
Author of Total Commander
https://www.ghisler.com
mas912
Junior Member
Junior Member
Posts: 6
Joined: 2012-03-15, 10:52 UTC

Post by *mas912 »

Hm, I tried to call ProcessDataProc and I can see progress now during unpacking:

Code: Select all

OpenArchive()

// first call
for each file
{
  ReadHeader()
  ProcessFile(PK_SKIP){ progress( curFile*-100/filesCount ); } <-- no progress here
} 

// unpack needed file
for each file until needed file
{
  ReadHeader()
  ProcessFile(PK_SKIP){ progress( curFile*-100/filesCount ); } <-- I can see progress here, which stops on curFile
} 

CloseArchive();  
no progress bar is supported while just reading headers, this would be very confusing for the user.
For example, WinRAR displays "reading archive... %d files processed" during opening TAR.GZ files. It is for example.
mas912
Junior Member
Junior Member
Posts: 6
Joined: 2012-03-15, 10:52 UTC

Post by *mas912 »

Did few tests:
OpenArchiveW, files 35993, timer reset

{ on first ReadHeaderEx call:
read descriptors: 0 sec
read files: 2 sec
}

next calls:
{copy file information to TC during ReadHeaderExW} * 36k times

on last call: measure time (2 sec)

CloseArchive (2 sec since OpenArchive)

// then here TC fills or builds own file list, it takes 2+ seconds too

// now FileList panel is ready, 4+ seconds from OpenArchive
Is it right? TC prepares or parses whole big file list (to build complete FileTree for navigation) after CloseArchive?

If yes, so this topic question would be resolved, because no sense to display progress after archive was readed completely.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, first TC reads the entire archive into memory, and then extracts just those files which are in the current archive subdirectory. This way the archive doesn't need to be re-read when the user changes to a different subdirectory within the archive.
Author of Total Commander
https://www.ghisler.com
Post Reply