Jump to content

Zip plugin


eltorro
 Share

Recommended Posts

Hi, i have this code:

#Include "VelkyPortable\Data\Backup\_ZipPlugin.au3"
$handle = PluginOpen(@ScriptDir & "\VelkyPortable\Data\Backup\Au3Zip.dll")
                            $hFile = _ZipCreate(@ScriptDir & "\VelkyPortable\Backups\" & $app & "_" & @YEAR & "-" & @MON & "-" & @MDAY & ".zip")
                            $v_ret = _ZipAddDir($hFile,@ScriptDir & "\VelkyPortable\Portable Apps\" & $cat & "\" & $app ,0)
                            $v_ret = _ZipClose($hFile)
                            PluginClose($handle)

It keeps giving me a 22byte large Zip file. (Which don't work) Why?

The 22 bytes is an empty zip file.

I traced the problem to a check for the source folder would fail.

Uploaded build 408

Edited by eltorro
Link to comment
Share on other sites

  • Replies 100
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 4 weeks later...
  • 3 weeks later...

Hi elTorro,

if I want to include the '_ZipPlugin.pll.au3' I'll get an errormessage from au3Check.

Line 53

Func _ZipPluginInit($szPluginPath = Default)
    If $ZIP_PLUGIN_INIT = -1
    If $szPluginPath = Default Then
        $szPluginPath = __Inline_Expand(Default,True)
        If $szPluginPath = "" Then
            MsgBox(266288,"Error:","Plugin Initialization failed")
            Return SetError(1,0,0)
        EndIf
    EndIf
    If Not FileExists($szPluginPath) Then
        MsgBox(266288,"Error:","Plugin not found.")
        Return SetError(1,0,0)
    EndIf
    $hPlugin = PluginOpen($szPluginPath)
    If $hPlugin = -1 Then
        MsgBox(266288,"Error:","Plugin could not be initialized.")
        Return SetError(1,0,0)
    EndIf
    $ZIP_PLUGIN_INIT = $hPlugin
    Return $hPlugin
EndFunc

If $ZIP_PLUGIN_INIT = -1

Greetz

Greenhorn

p.s.

Oh, please could you explain for which use is the '_ZipPlugin.pll.au3' and for which is the '_ZipPlugin.au3'

Thank you

Edited by Greenhorn
Link to comment
Share on other sites

  • 2 weeks later...

Hi elTorro,

if I want to include the '_ZipPlugin.pll.au3' I'll get an errormessage from au3Check.

Line 53

Func _ZipPluginInit($szPluginPath = Default)
    If $ZIP_PLUGIN_INIT = -1
    If $szPluginPath = Default Then
        $szPluginPath = __Inline_Expand(Default,True)
        If $szPluginPath = "" Then
            MsgBox(266288,"Error:","Plugin Initialization failed")
            Return SetError(1,0,0)
        EndIf
    EndIf
    If Not FileExists($szPluginPath) Then
        MsgBox(266288,"Error:","Plugin not found.")
        Return SetError(1,0,0)
    EndIf
    $hPlugin = PluginOpen($szPluginPath)
    If $hPlugin = -1 Then
        MsgBox(266288,"Error:","Plugin could not be initialized.")
        Return SetError(1,0,0)
    EndIf
    $ZIP_PLUGIN_INIT = $hPlugin
    Return $hPlugin
EndFunc

If $ZIP_PLUGIN_INIT = -1

Greetz

Greenhorn

p.s.

Oh, please could you explain for which use is the '_ZipPlugin.pll.au3' and for which is the '_ZipPlugin.au3'

Thank you

Should be if $ZIP_PLUGIN_INIT = -1 Then

Uploaded fixed archive.

Edited by eltorro
Link to comment
Share on other sites

  • 4 weeks later...

I know it's been covered in the past, but I keep getting unknown function when I try to use this. I gather it's because the function is in the dll, however I've got your DLLs in many places (include folder, include\au3zip\bin folder, in the folder where scite is kept) and I cannot for the life of me get your script "PluginZip.au3" to run. I made the changes necessary for the newer autoit (gui constants) but it still crashes due to an unknown function.

What on earth am I doing wrong? Where do I need to put these darned DLLs?

Note: I am running your demo script straight from "C:\Program Files\AutoIt3\Include\Au3Zip\bin\PluginZip.au3".

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files\AutoIt3\Include\Au3Zip\bin\PluginZip.au3"

1

C:\Program Files\AutoIt3\Include\Au3Zip\bin\PluginZip.au3 (52) : ==> Unknown function name.:

$hFile = _ZipCreate("test.zip")

$hFile = ^ ERROR

>Exit code: 1 Time: 1.969

EDIT: Actually, nevermind, I'm just a total moron. For anyone else who is also a total moron, there is a plugin line in the sample script that references a full path to the DLL, so you'll need to change this.

Edited by nago
Link to comment
Share on other sites

  • 4 weeks later...

I have been reading the posts on this forum, however cannot use the wonderful "eltorro zip plugin". Hopefully i have attached my code correctly, as this is the first time i have ever posted on a forum. I tried to create a simple program to unzip a .zip file however cannot understand why it is not working...The paths to any required files should be correct, the problem is however that the PluginOpen() returns a "0" and the if statement is never executed. Can anyone help? i am really anxious to get this thing working. Attached to this post should be my code. I am new to this, so i apologize in advance if i am not doing something correctly.

#include <GUIConstants.au3>;path:  C:\Documents and Settings\user\Autoit\install\Include
#Include <_ZipPlugin.au3>  ;path:  C:\Documents and Settings\user\Autoit\install\Include

Local $handle, $destination, $filepath, $filename

$destination = "C:\Documents and Settings\user\autoit_tests\PluginTest"
$filepath = "C:\Documents and Settings\user\autoit_tests\ok_ver.3"
$filename = "YT_Download_Center.zip"
$handle1 = PluginOpen("C:\Documents and Settings\user\autoit_tests\ok_ver.3\Au3Zip.dll");specified the full path of .dll
;$handle2 = PluginOpen("C:\Documents and Settings\user\autoit_tests\ok_ver.3\Au3Zip.dll");identical PluginOpen() statement as above, 
;                                                                                        -but saved as $handle2 (testing return value)

MsgBox(0, "handle1", $handle1);displays the value of $handle1
;MsgBox(0, "handle2", $handle2);displays the value of $handle2

if ($handle1 <> 0) Then
        _ZipUnzipItem($filepath, $filename, $destination)
        ; _ZipUnZipItem(($ZipFile,$FileNameInsideZip,$Dest) UnZip a single file.
        MsgBox(0, "in statement", "here1")
endif

PluginClose($handle1)
MsgBox(0, "out of statement", "here2")

Exit

;For some reason $handle returns "0" and the if statement is never executed. Why doesn't this work?
;
;FYI the function call "PluginOpen()"  is not contained within the (SciTEAutoIt3 ver.1.76) help section...
;-I browsed the internet and could only find 2 things about it...1st that it is suppose to return a handle
;-and second that if not successful it will return "0". 
;
;Also after playing with "PluginOpen()" i found that if i created, $handle2, a second variable with the same declaration as $handle1, they would return different values.
;In this case $handle1 is false but if i uncomment $handle2, $handle1 will still return "0" and $handle2 will return "1"....can anyone tell me why this is?
;
;Overall i would like to be able to successfully unzip a specified.zip file to a specified location. PLEASE HELP...
Link to comment
Share on other sites

  • 2 weeks later...

I have been reading the posts on this forum, however cannot use the wonderful "eltorro zip plugin". Hopefully i have attached my code correctly, as this is the first time i have ever posted on a forum. I tried to create a simple program to unzip a .zip file however cannot understand why it is not working...The paths to any required files should be correct, the problem is however that the PluginOpen() returns a "0" and the if statement is never executed. Can anyone help? i am really anxious to get this thing working. Attached to this post should be my code. I am new to this, so i apologize in advance if i am not doing something correctly.

#include <GUIConstants.au3>;path:  C:\Documents and Settings\user\Autoit\install\Include
#Include <_ZipPlugin.au3> ;path:  C:\Documents and Settings\user\Autoit\install\Include

Local $handle, $destination, $filepath, $filename

$destination = "C:\Documents and Settings\user\autoit_tests\PluginTest"
$filepath = "C:\Documents and Settings\user\autoit_tests\ok_ver.3"
$filename = "YT_Download_Center.zip"
$handle1 = PluginOpen("C:\Documents and Settings\user\autoit_tests\ok_ver.3\Au3Zip.dll");specified the full path of .dll
;$handle2 = PluginOpen("C:\Documents and Settings\user\autoit_tests\ok_ver.3\Au3Zip.dll");identical PluginOpen() statement as above, 
;                                                                                        -but saved as $handle2 (testing return value)

MsgBox(0, "handle1", $handle1);displays the value of $handle1
;MsgBox(0, "handle2", $handle2);displays the value of $handle2

if ($handle1 <> 0) Then
        _ZipUnzipItem($filepath, $filename, $destination)
    ; _ZipUnZipItem(($ZipFile,$FileNameInsideZip,$Dest) UnZip a single file.
        MsgBox(0, "in statement", "here1")
endif

PluginClose($handle1)
MsgBox(0, "out of statement", "here2")

Exit

;For some reason $handle returns "0" and the if statement is never executed. Why doesn't this work?
;
;FYI the function call "PluginOpen()"  is not contained within the (SciTEAutoIt3 ver.1.76) help section...
;-I browsed the internet and could only find 2 things about it...1st that it is suppose to return a handle
;-and second that if not successful it will return "0". 
;
;Also after playing with "PluginOpen()" i found that if i created, $handle2, a second variable with the same declaration as $handle1, they would return different values.
;In this case $handle1 is false but if i uncomment $handle2, $handle1 will still return "0" and $handle2 will return "1"....can anyone tell me why this is?
;
;Overall i would like to be able to successfully unzip a specified.zip file to a specified location. PLEASE HELP...
Checking of the handle returned from PluginOpen is different than what I remember. PluginOpen has been removed from the help file, so I'm not sure what it supposed to return anymore. I did a little test calling a bogus plugin and PluginOpen return -1. Calling PluginOpen with the zipplugin returns 0. The IsHwnd function does return true in either case.

So, to check if the plugin loaded, it should be:

if ($handle1 = 0) Then
        _ZipUnzipItem($filepath, $filename, $destination)
    ; _ZipUnZipItem(($ZipFile,$FileNameInsideZip,$Dest) UnZip a single file.
        MsgBox(0, "in statement", "here1")
                PluginClose($handle1)

endif

One item I have to review is whether or not the destination directory needs to exist as it does when creating a zip.

Link to comment
Share on other sites

  • 2 weeks later...

Hi, i cant extract the zip file using this plugins.

my code:

#include-once
#Include <_ZipPlugin.au3>

Local $hPlugin, $hZip , $ZR_RECENT = 1
$hPlugin = PluginOpen(@ScriptDir&"\Au3Zip.dll")
if $hPlugin then
    $hZip = ZipUnZip( "test.zip", @ScriptDir)
    PluginClose($hPlugin)
endif

it just give this msg in syntax check:

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Downloads\Compressed\Launcher+autopatch+source\Au3_Zip\bin\testzip.au3"  
1
>Exit code: 0   Time: 0.207

no error but no files is extracting from the zip files. is something wrong with my code?

i have copy _ZipPlugin.au3, dll to autoit include folder and to ScriptDir still the same.

Btw, does this plugin support silent overwrite?

Link to comment
Share on other sites

  • 1 month later...

Thanks for this great udf. :)

fixed above post: i can extract now.

edited unzip example with progress bar.

#include <GUIConstants.au3>
#include <ListViewConstants.au3>
#Include <_ZipPlugin.pll.au3>

#Region ### START Koda GUI section ### Form=
$ZipPluginTest = GUICreate("ZipPluginTest", 633, 487, 193, 115)
$btnList2Array = GUICtrlCreateButton("List2Array", 20, 410, 75, 25, 0)
$btnGetCount = GUICtrlCreateButton("GetCount", 120, 410, 75, 25, 0)
$btnZipItemInfo2Array = GUICtrlCreateButton("ZipItemInfo2Array", 220, 410, 175, 25, 0)
$btnUnzip = GUICtrlCreateButton("Unzip", 420, 410, 75, 25, 0)
$btnExit = GUICtrlCreateButton("Exit", 520, 410, 75, 25, 0)
$Progress1 = GUICtrlCreateProgress(22, 440, 580, 17)
$Label1 = GUICtrlCreateLabel("", 22, 460, 302, 17)
GUICtrlSetState(-1, $GUI_DISABLE)
$edtListView = GuiCtrlCreateListView(" |Name       |Ctime|Mtime|Size|Ratio|Packed",10,10,610,185)
    GUICtrlSendMsg($edtListView, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
    GUICtrlSendMsg($edtListView, 0x101E, 1, 150)
    
;GUICtrlSendMsg($ListView1, 0x101E, 1, 150)

$edtOutput = GUICtrlCreateEdit("", 10, 200, 610, 184)
GUICtrlSetData(-1, "")
GUICtrlSetFont(-1, 10, 400, 0, "Courier New")
GUICtrlSetColor(-1, 0xFFFF00)
GUICtrlSetBkColor(-1, 0x000000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GuiCtrlSetState($btnExit,$GUI_ENABLE)

;My Zip file
$ZipFILE = "SealGG12Sep08.zip"

Local $handle, $v_ret,$msg
if (($handle = PluginOpen("C:\Au3Zip\bin\Au3Zip.dll")) <> 0) Then
$ZR_RECENT =1
EndIf

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $btnExit
            Exit
        Case $btnList2Array
        GUICtrlSetData($Progress1, 0)
        GuiCtrlSetState($btnExit,$GUI_DISABLE)
Local $szZipFiles = _ZipList2Array($ZipFILE) 
$Percent = 0
$Sum = 0
For $x = 0 to UBound($szZipFiles,1)-1
;ConsoleWrite($x&@LF)
    if Not @error then
    $msg &= ("Index:"&$szZipFiles[$x][$ZIP_INDEX]&@CRLF)
    $msg &= ("Name :"&$szZipFiles[$x][$ZIP_NAME]&@CRLF)
    $msg &= ("Atime:"&$szZipFiles[$x][$ZIP_ATIME]&@CRLF)
    $msg &= ("Ctime:"&$szZipFiles[$x][$ZIP_CTIME]&@CRLF)
    $msg &= ("Mtime:"&$szZipFiles[$x][$ZIP_MTIME]&@CRLF)
    $msg &= ("CSize:"&$szZipFiles[$x][$ZIP_CSIZE]&@CRLF)
    $msg &= ("USize:"&$szZipFiles[$x][$ZIP_USIZE]&@CRLF)
    $msg &= (@CRLF)
    $item = StringFormat("%s|%s|%s|%s|%s|%s|%s",$szZipFiles[$x][$ZIP_INDEX],$szZipFiles[$x][$ZIP_NAME],$szZipFiles[$x][$ZIP_CTIME], _ 
                                                            $szZipFiles[$x][$ZIP_MTIME],$szZipFiles[$x][$ZIP_USIZE],_ZipGetRatio($szZipFiles[$x][$ZIP_CSIZE],$szZipFiles[$x][$ZIP_USIZE])&"%",$szZipFiles[$x][$ZIP_CSIZE])
    GUICtrlCreateListViewItem($item,$edtListView)
    $CurrentSize = $szZipFiles[$x][$ZIP_CSIZE]
    If Not $x = 0 Then
    $Percents = ( $x / (UBound($szZipFiles,1)-1) ) * 100
    GUICtrlSetData($Progress1, $Percents)
    $CurrentSize = $szZipFiles[$x][$ZIP_CSIZE] + $CurrentSize
    $Sum += $szZipFiles[$x][$ZIP_CSIZE]
    EndIf
    GUICtrlSetData($Label1, "Size: " & ConvertSize($CurrentSize) & "/" & ConvertSize($Sum) & " Total Files: " & UBound($szZipFiles,1)-1)
endif

    For $i = 0 to UBound($szZipFiles,1)-1
    $TotalSize = $szZipFiles[$i][$ZIP_CSIZE]
    _AddMessage($edtOutput,$TotalSize)
    Next
Next
;GUICtrlSetData($Label1, "Done.")
    _AddMessage($edtOutput,$msg)
    GuiCtrlSetState($btnExit,$GUI_ENABLE)
        
    Case $btnGetCount
GUICtrlSetData($Progress1, 0)
$numitems = _ZipGetCount($ZipFILE)
_AddMessage($edtOutput,"_ZipGetList:NumItems>"&($numitems))
Local $szZipFiles = _ZipList2Array($ZipFILE)
Local $msg="File List"&@CRLF
For $x = 0 to UBound($szZipFiles,1)-1
    $msg &= ("Index:"&$szZipFiles[$x][$ZIP_INDEX]&@CRLF)
    $msg &= ("Name :"&$szZipFiles[$x][$ZIP_NAME]&@CRLF)
    $msg &= ("Atime:"&$szZipFiles[$x][$ZIP_ATIME]&@CRLF)
    $msg &= ("Ctime:"&$szZipFiles[$x][$ZIP_CTIME]&@CRLF)
    $msg &= ("Mtime:"&$szZipFiles[$x][$ZIP_MTIME]&@CRLF)
    $msg &= ("CSize:"&$szZipFiles[$x][$ZIP_CSIZE]&@CRLF)
    $msg &= ("USize:"&$szZipFiles[$x][$ZIP_USIZE]&@CRLF)
    $msg &= (@CRLF)

    If Not $x = 0 Then
    $Percents = ( $x / (UBound($szZipFiles,1)-1) ) * 100
    GUICtrlSetData($Progress1, $Percents)
    EndIf
Next
;MsgBox(0,"Files",$msg)
_AddMessage($edtOutput,$msg)

    Case $btnZipItemInfo2Array
;==============================================================================
; Show a list of file info for a file in the zip
;_ZipItemInfo2Array($ZipFile,$ItemIndex)
;==============================================================================
Local   $szZipFiles = _ZipItemInfo2Array($ZipFILE,1)
    if Not(@error) Then
    $msg &= ("Index:"&$szZipFiles[$ZIP_INDEX]&@CRLF)
    $msg &= ("Name :"&$szZipFiles[$ZIP_NAME]&@CRLF)
    $msg &= ("Atime:"&$szZipFiles[$ZIP_ATIME]&@CRLF)
    $msg &= ("Ctime:"&$szZipFiles[$ZIP_CTIME]&@CRLF)
    $msg &= ("Mtime:"&$szZipFiles[$ZIP_MTIME]&@CRLF)
    $msg &= ("CSize:"&$szZipFiles[$ZIP_CSIZE]&@CRLF)
    $msg &= ("USize:"&$szZipFiles[$ZIP_USIZE]&@CRLF)
    $msg &= (@CRLF)
    $item = StringFormat("%s|%s|%s|%s|%s|%s|%s",$szZipFiles[$ZIP_INDEX],$szZipFiles[$ZIP_NAME],$szZipFiles[$ZIP_CTIME], _ 
                                                            $szZipFiles[$ZIP_MTIME],$szZipFiles[$ZIP_USIZE],_ZipGetRatio($szZipFiles[$ZIP_CSIZE],$szZipFiles[$ZIP_USIZE])&"%",$szZipFiles[$ZIP_CSIZE])
    GUICtrlCreateListViewItem($item,$edtListView)

    EndIf
    _AddMessage($edtOutput,$msg)

$v_ret = _ZipGetCount($ZipFILE)
_AddMessage($edtOutput,'_ZipGetList($ZipFILE)')
_AddMessage($edtOutput,"_ZipGetList:return code>"&($v_ret))

    Case $btnUnzip
    GUICtrlSetData($Progress1, 0)
;UNZIP
    $szDestDir = @ScriptDir & "\zip_utils_srct"
    $szPattern = "*"
    $vResult = 0
    $aZipList = _ZipList2Array($ZipFILE)
    For $x =0 to UBound($aZipList) -1
        If __ZipWildCardMatch($aZipList[$x][1],StringReplace($szPattern,"/","\"),0) Then
            GUICtrlSetData($Label1, "Extracting: " & $aZipList[$x][1] & "(" & ConvertSize($aZipList[$x][6]) & ")" )
            $vResult = _ZipUnZipItem($ZipFILE,$aZipList[$x][1],$szDestDir)
            If $vResult <> 0 Then Return SetError(1,$vResult,0)
            EndIf

        If Not $x = 0 Then
        $Percents = ( $x / (UBound($aZipList) -1) ) * 100
        GUICtrlSetData($Progress1, $Percents)
        EndIf
    Next
    GUICtrlSetData($Label1, "Done.")
    ConsoleWrite("@error= "&@error);
    _AddMessage($edtOutput,"_ZipUnZip:return code>"&$vResult)
    _AddMessage($edtOutput,_ZipFormatMessage($vResult))

    EndSwitch
WEnd    

Func _AddMessage($edtOutput,$msg,$flag =1)
    GuiCtrlSetData($edtOutput,$msg&@CRLF,$flag)
EndFunc

Func ConvertSize($inputSize, $inputUnit = 0, $outputPlaces = 2, $outputString = True, $inputBits = False, $outputBits = False, $outputUnit = -4)
    Local $unitNames[9] = ["","K","M","G","T","P","E","Z","Y"]
    Local $bytes = $inputSize * 1024 ^ $inputUnit
    Local $b = "B"
    If $inputBits Then $bytes /= 8
    If $outputBits Then
        $bytes *= 8
        $b = "b"
    EndIf
    If $outputUnit < 0 Then
        Local $outputMax = Abs($outputUnit)
        $outputUnit = Int(Log($bytes)/Log(1024))
        If $outputUnit > $outputMax Then $outputUnit = $outputMax
    EndIf
    If $outputString Then
        Return String(Round($bytes / 1024 ^ $outputUnit, $outputPlaces)) & $unitNames[$outputUnit] & $b
    Else
        Return Round($bytes / 1024 ^ $outputUnit, $outputPlaces)
    EndIf
EndFunc
Edited by FireNET
Link to comment
Share on other sites

Thanks Eltorro.. very nicely written, this will come in handy.

FireNET, are you the author of the ConvertSize() function (inside your example)..

Func ConvertSize($inputSize, $inputUnit = 0, $outputPlaces = 2, $outputString = True, $inputBits = False, $outputBits = False, $outputUnit = -4)
    Local $unitNames[9] = ["","K","M","G","T","P","E","Z","Y"]
    Local $bytes = $inputSize * 1024 ^ $inputUnit
    Local $b = "B"
    If $inputBits Then $bytes /= 8
    If $outputBits Then
        $bytes *= 8
        $b = "b"
    EndIf
    If $outputUnit < 0 Then
        Local $outputMax = Abs($outputUnit)
        $outputUnit = Int(Log($bytes)/Log(1024))
        If $outputUnit > $outputMax Then $outputUnit = $outputMax
    EndIf
    If $outputString Then
        Return String(Round($bytes / 1024 ^ $outputUnit, $outputPlaces)) & $unitNames[$outputUnit] & $b
    Else
        Return Round($bytes / 1024 ^ $outputUnit, $outputPlaces)
    EndIf
EndFunc

If not, thanks for sharing none the less! :)

Edited by mrRevoked
Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
Link to comment
Share on other sites

  • 1 month later...

Hi to all. This is my 1st post because I try to get out of problems by myself :mellow: but unfortunatly this is not the case :(

The problem is that I try to get some data out of a zip file with the zip plugin but I get garbage... It seems that I cannot get the correct date and time with autoit version 3.2.12.1 but with version 3.2.8.1 it seems ok!

here the code:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.12.1
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <GUIConstants.au3>
#Include <_ZipPlugin.au3>

PluginOpen("C:\Documents and Settings\admin\Desktop\autoit\test\Au3Zip\bin\Au3Zip.dll")
dim $msg
Local $szZipFiles = _ZipList2Array("a.zip") 
For $x = 0 to UBound($szZipFiles,1)-1
    ConsoleWrite($x&@LF)
    if Not @error then
    $msg &= ("Index:"&$szZipFiles[$x][$ZIP_INDEX]&@CRLF)
    $msg &= ("Name :"&$szZipFiles[$x][$ZIP_NAME]&@CRLF)
    $msg &= ("Atime:"&$szZipFiles[$x][$ZIP_ATIME]&@CRLF)
    $msg &= ("Ctime:"&$szZipFiles[$x][$ZIP_CTIME]&@CRLF)
    $msg &= ("Mtime:"&$szZipFiles[$x][$ZIP_MTIME]&@CRLF)
    $msg &= ("CSize:"&$szZipFiles[$x][$ZIP_CSIZE]&@CRLF)
    $msg &= ("USize:"&$szZipFiles[$x][$ZIP_USIZE]&@CRLF)
    $msg &= (@CRLF)
    $item = StringFormat("%s|%s|%s|%s|%s|%s|%s",$szZipFiles[$x][$ZIP_INDEX],$szZipFiles[$x][$ZIP_NAME],$szZipFiles[$x][$ZIP_CTIME], _ 
                                                            $szZipFiles[$x][$ZIP_MTIME],$szZipFiles[$x][$ZIP_USIZE],_ZipGetRatio($szZipFiles[$x][$ZIP_CSIZE],$szZipFiles[$x][$ZIP_USIZE])&"%",$szZipFiles[$x][$ZIP_CSIZE])
    ConsoleWrite($item)
    endif   
Next

the output is like this:

0|Distributore_Metano.bmp|00/00/0 00:00:00AM|01/01/1601 07:05:19PM|1|-38100%|3821
1|Distributore_Metano.csv|09/09/21865 09:54:41AM|03/31/1601 09:55:57AM|1567199730|99%|419152
2|LeggimiBene.doc|01/25/22017 07:44:11AM|02/02/1601 03:46:54AM|1567199730|99%|291843

as you can see the date time are absurd.

here you can see the real date/time

http://img89.imageshack.us/my.php?image=zipdatetimegy1.jpg

could it somehow be that the problem is because I'm using an italian xp version?

keep in mind that with the previous version of autoit it was ok!

Thanks for your time and patience.

Gian

Link to comment
Share on other sites

  • 3 months later...

Hey guys, fantastically useful addition to AutoIt but I've got two questions.

If you don't have WinZip installed to handle your zip files, does this script still work? So if you use winrar (heaven forfend) or the basic Windows zip handler.

What happens when you complie your script and make an exe, do you just need to supply the two dlls to whoever needs to use the exe or do they need the Au3Zip au3 files too?

Link to comment
Share on other sites

Sorry for the double post, but also,

does the process wait while the files are extracted? Say I have a 700meg zip file of a 2gb text file (or something outrageously large) and do something like (just as an example, this isn't what I'm looking to do at all!)

Func Games()
_ZipUnZip($bigTextZip, "C:")
FileRead("C:\bigTextFile.txt")
EndFunc

would that fall over because the file is still being extracted as it runs the function or does it wait until extraction is complete?

Link to comment
Share on other sites

I tried out this plugin but my script crashes when I use the _ZipAddDir:

1
Trying:C:\Users\Administrator\Desktop\test.zip
>Exit code: -1073741819 Time: 10.190

The files are all in the zip but when I try to extract the files using winzip it says "Unknown Format". When I remove the _ZipAddDir-command everything works fine (zip with size of 22 bytes created). What's wrong?

Edited by zielke
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...