parallel unzip in progress

Jay Norwood jayn at prismnet.com
Tue Apr 3 23:31:13 PDT 2012


On Tuesday, 3 April 2012 at 05:27:08 UTC, Jay Norwood wrote:

..........
So, to answer my own questions ... I placed the code below in a 
taskpool parallel foreach loop, where each am is an archive 
member.  It is expanded,  and the expanded data is written to a 
file.  The original time info is coverted to SysTime using a 
localTime() tz timezone calculated outside the loop.  Then the 
setTimes call updates the file timestamp in Windows.  I just used 
the same system time st value for modification and access times.

expand2(am);
string destFilename = destName ~ am.name;
std.file.write(destFilename,am.expandedData);
SysTime st = DosFileTimeToSysTime(am.time, tz);
std.file.setTimes(destFilename, st, st);

The whole unzip, including restore of file modification times,  
completed in under 17 seconds for this 2GB expanded directory 
structure with some 39K files.  7zip took 55 seconds.


This particular loop is currently excluding restore of times on 
directory entries, but I suppose I can restore the directory 
times after all the files have been expanded into the directory 
structure.


More information about the Digitalmars-d-learn mailing list