PDA

View Full Version : Filename of a currently extracted file from a zip file



gridrunner
08-28-2006, 03:30 AM
I want to get the full path and name of the file that gets currently extracted from a zip file using the Zip.Extract funtion. The return value (string) in the callback funktion seems returns 'item x of y'.

Here the function i use:

function ShowExtract(String, Percent)
DlgProgressBar.SetPos(CTRL_PROGRESS_BAR_01, Percent);
DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 01, {Text=String, Visible=true});
return true;
end

function extractFiles()
source = SessionVar.Expand("%AppFolder%").."\\media.zip";
target = SessionVar.Expand("%AppFolder%");
Zip.Extract(source, {"*.*"}, target, true, true, "", 3, ShowExtract);
end


Thanks for help.

gridrunner
08-28-2006, 07:12 AM
I modified the function to show only the total progress of unzipping. Still looking to get file name from String.

function ShowExtract(String, Percent, Status)
if (Status == 0) then
DlgProgressBar.SetPos(CTRL_PROGRESS_BAR_01, Percent);
DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 01, {Text=String, Visible=true});
end
return true;
end

function extractFiles()
source = SessionVar.Expand("%AppFolder%").."\\media.zip";
target = SessionVar.Expand("%AppFolder%");
Zip.Extract(source, {"*.*"}, target, true, true, "", ZIP_OVERWRITE_ALWAYS, ShowExtract);
end