UEZ Posted December 14, 2008 Share Posted December 14, 2008 I have a question regarding the "wait for finish" of zip process! When you add a huge file / folder to a zip file using the internal zip (as posted in previous posts), how do you know when the file / folder to zip is finished? As far as I know you need to wait in a loop until the zip process is ended otherwise it will be interrupted! Here a snippet: ... $obj_Copy = $obj_ZIP.NameSpace($zip_filename).CopyHere($obj_Folder.Items, $flag) ;add files to ZIP archive While 1 If $obj_Copy has finished Then ExitLoop ;not AutoIt syntax WEnd UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
TheSaint Posted December 14, 2008 Share Posted December 14, 2008 I have a question regarding the "wait for finish" of zip process!When you add a huge file / folder to a zip file using the internal zip (as posted in previous posts), how do you know when the file / folder to zip is finished? As far as I know you need to wait in a loop until the zip process is ended otherwise it will be interrupted!Here a snippet:...$obj_Copy = $obj_ZIP.NameSpace($zip_filename).CopyHere($obj_Folder.Items, $flag) ;add files to ZIP archiveWhile 1 If $obj_Copy has finished Then ExitLoop ;not AutoIt syntaxWEndUEZI'm not an expert on this by any means, and I have never thrown a huge file at _ZipAdd, though I have done some largish ones on occasion. I always incorporate a Splash Screen during the process, and if I remember rightly, the splash stays visible a little longer, so I think you may have no problem. However, if you have posted because you did have a problem, then obviously I'm talking out of my arse. The PsaltyDS or one of the other contributors might have a better idea than me ... I just use it.If you haven't yet tested your issue, maybe download my Create Zip Within program from here, and see if you can rush the program with sizeable folder content, and maybe end up with a failed zip. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
UEZ Posted December 15, 2008 Share Posted December 15, 2008 I'm not an expert on this by any means, and I have never thrown a huge file at _ZipAdd, though I have done some largish ones on occasion. I always incorporate a Splash Screen during the process, and if I remember rightly, the splash stays visible a little longer, so I think you may have no problem. However, if you have posted because you did have a problem, then obviously I'm talking out of my arse. The PsaltyDS or one of the other contributors might have a better idea than me ... I just use it.If you haven't yet tested your issue, maybe download my Create Zip Within program from here, and see if you can rush the program with sizeable folder content, and maybe end up with a failed zip.Currently I haven't a 100% solution but my idea was to check the thread which creates the zip file. Look here. During my tests it didn't exit the loop because thread count before wasn't equal with after zip task.Checking file access isn't also not working 100%.UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
torels Posted December 15, 2008 Share Posted December 15, 2008 I have a question regarding the "wait for finish" of zip process!When you add a huge file / folder to a zip file using the internal zip (as posted in previous posts), how do you know when the file / folder to zip is finished? As far as I know you need to wait in a loop until the zip process is ended otherwise it will be interrupted!Here a snippet:...$obj_Copy = $obj_ZIP.NameSpace($zip_filename).CopyHere($obj_Folder.Items, $flag) ;add files to ZIP archiveWhile 1 If $obj_Copy has finished Then ExitLoop ;not AutoIt syntaxWEndUEZYou count hte files in the zip filewhen there are theoldfiles+1 then the file has been addedgo take a look at my udf! Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
TheSaint Posted December 15, 2008 Share Posted December 15, 2008 Currently I haven't a 100% solution but my idea was to check the thread which creates the zip file. Look here. During my tests it didn't exit the loop because thread count before wasn't equal with after zip task.Checking file access isn't also not working 100%.UEZWhat you've done there, looks pretty good. I don't know if I can help, but I'll take a look when I can.You may want to check out Torels zip UDF, it is a lot more current than the one here, and he's probably catered for what your asking. I think he's saying something along those lines anyway. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
UEZ Posted December 15, 2008 Share Posted December 15, 2008 You count hte files in the zip file when there are theoldfiles+1 then the file has been added go take a look at my udf! I tried to understand your code already and asked you a question to understand the functionality of the zip function: $obj_Copy = $obj_ZIP.NameSpace($zip_filename).CopyHere($obj_Folder.Items, $flag) <- this will start to add a folder to a zip file in the backround. You can check the object $obj_Copy as long as it is running in the backround but when it is finished then your check will not work anymore (see bold line below). Just an example from your code: ... $files = _Zip_Count($hZipFile) $oApp = ObjCreate("Shell.Application") $oFolder = $oApp.NameSpace($hFolder) $oCopy = $oApp.NameSpace($hZipFile).CopyHere($oFolder.Items, $flag) $oFC = $oApp.NameSpace($hFolder).items.count While 1 If _Zip_Count($hZipFile) = ($files+$oFC) Then ExitLoop WEnd ... Func _Zip_Count($hZipFile) Local $DLLChk = _Zip_DllChk() If $DLLChk <> 0 Then Return SetError($DLLChk, 0, 0) ;no dll If not _IsFullPath($hZipFile) then Return SetError(4,0) ;zip file isn't a full path If Not FileExists($hZipFile) Then Return SetError(1, 0, 0) ;no zip file $items = _Zip_List($hZipFile) Return UBound($items) - 1 EndFunc ;==>_Zip_Count ... Func _Zip_List($hZipFile) local $aArray[1] Local $DLLChk = _Zip_DllChk() If $DLLChk <> 0 Then Return SetError($DLLChk, 0, 0) ;no dll If not _IsFullPath($hZipFile) then Return SetError(4,0) ;zip file isn't a full path If Not FileExists($hZipFile) Then Return SetError(1, 0, 0) ;no zip file $oApp = ObjCreate("Shell.Application") $hList = $oApp.Namespace($hZipFile).Items For $item in $hList _ArrayAdd($aArray,$item.name) Next $aArray[0] = UBound($aArray) - 1 Return $aArray EndFunc ;==>_Zip_List I made some test and the access to the object (shell application) worked as long as the zip thread is running in the backround. When it is finished you will get an error message like ...Object referenced outside a "With" statement... Maybe I'm to stupid to understand or thinking to much complicated... You can say why don't you use my udf and ask silly questions but I want to understand how it is working... UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
UEZ Posted December 16, 2008 Share Posted December 16, 2008 (edited) I test it on my Vista x32:#include <Zip.au3> ;[b]torels' UDF[/b] Global $zip_file = "c:\Test.zip" Global $source_folder = "C:\Windows\Inf\" _Zip_Create($zip_file) _Zip_AddFolder($zip_file , $source_folder )oÝ÷ ØȦ·¬°^méÛº+pYlµªí¶vØ^~]z»hk8©j·!÷¿»öÛºÜ!z{ayìmz¹ÚØky§ajǧuçméÈÂ)eç÷+¢Z+¡÷ôÓM,¥©ì·)^is is working properly!I think I found why I get the error -> $zip = _Zip_Create($zip_file). I need a filehandle...1 step closer... maybe I will understand now UEZ Edited December 16, 2008 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
torels Posted December 16, 2008 Share Posted December 16, 2008 I test it on my Vista x32: #include <Zip.au3> ;[b]torels' UDF[/b] Global $zip_file = "c:\Test.zip" Global $source_folder = "C:\Windows\Inf\" _Zip_Create($zip_file) _Zip_AddFolder($zip_file , $source_folder )oÝ÷ ØȦ·¬°^méÛº+pYlµªí¶vØ^~]z»hk8©j·!÷¿»öÛºÜ!z{ayìmz¹ÚØky§ajǧuçméÈÂ)eç÷+¢Z+¡÷ôÓM,¥©ì·)^ is is working properly! I think I found why I get the error -> $zip = _Zip_Create($zip_file). I need a filehandle... 1 step closer... maybe I will understand now UEZyes... it should be supposedf to work with the first method to... I'll check that tonight when I get home Anyway... new release coming out Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
Skysnake Posted September 6, 2010 Share Posted September 6, 2010 It seems to appear for big size file adding Anyway... thanx for effort. Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Skysnake Posted September 6, 2010 Share Posted September 6, 2010 This is truly cool. Will this be added to the Ultimate Scripts or similar? Skysnake Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 7, 2010 Share Posted September 7, 2010 This is truly cool. Will this be added to the Ultimate Scripts or similar?Did you notice this topic is almost two years old? What did you mean by "Ultimate Scripts"? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Skysnake Posted September 22, 2010 Share Posted September 22, 2010 Did you notice this topic is almost two years old? What did you mean by "Ultimate Scripts"?Dear Most Venerable PenguinI downloaded a file called 'Ultimate AutoIt Scripts Collection' which is very cool.This is the Readme:This is a compilation of AutoIt scripts created by the members on the forum. Included so far:1>Woods Mini Web Server (nfwu)2>BenEditor(AutoItKing)3>Sliding Launcher Toolbar(Valuater, Simucal, AutoItKing)4>Yahtzee(th.meger)5>Analog Clock(greenmachine,Credit - Larry (region funcs), neogia (anti-flicker, erasing old lines), Valuater (tray, transparency)6>InvertorGame (James Bench)7>Marfdaman's Mediaplayer(marfdaman)8>AutoIt-123(Valuater)9>Internet Explorer Automation UDF Library and IE-Builder for AutoIt3(Dale Hohm)10>Emailer(JdeB and AutoItKing)11>Small Downloader (Felix N.)12>ProPlayer (npam)So I figured that something as cool as this should be added to something as cool as the Ultimate Scripts Collection. Good things never go old ;-)Does the answer of the newbie satisfy the master?Skysnake Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 23, 2010 Share Posted September 23, 2010 (edited) A link would have been more helpful, but I found it anyway: The best scripts I also note the last post in that topic was March 2007.Unfortunately, good things DO get old (at least in the IT world). Great scripts cease to be great when they don't work with the current version anymore. As a compilation, it would have to be kept up to date or it becomes actually harmful. For example, Dale Hohm's IE.au3 UDF has been part of AutoIt's standard distribution for years, and Valuater's AutoIt 1-2-3 tutorial is maintained in a topic where the latest version is always available. Are the versions you get from this collection that up to date?This post by the originator of the "Ultimate Scripts" collection is particularly instructive (remember it's from 2007): That "guy" is me. And I fixed that a while ago, but not in here though.Actually, it'd be nice if someone else took this over for me. (the collection, not beneditor)I got a lot of other stuff to do.Like web mastering, graphics design, school, etc.I don't have that much time on my hands.And I'm not up for devising a huge management operation for this thing.So... any takers?There were no takers. Edited September 23, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 23, 2010 Moderators Share Posted September 23, 2010 Skysnake ,If you want to zip using the Windows zipfldr.dll library within AutoIt I would heartily recommend wraithdu's new Zip UDF. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Skysnake Posted September 27, 2010 Share Posted September 27, 2010 Thank you kindly, good sir ;-) Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
RPrice Posted May 12, 2013 Share Posted May 12, 2013 For compressing larger file, sleep(5000) isn't long enough. But replacing Sleep(5000) with WinWaitActive("Compressing","",10000) WinWaitClose("Compressing") Seems to fix that problem. Link to comment Share on other sites More sharing options...
RPrice Posted May 12, 2013 Share Posted May 12, 2013 I just realised that the post I was replying to a post from 2006 so what about to post and my last post may be irrelevant. Also instead of the input box for selecting the zip, use FileSaveDialog("Create Zip File","","PK-Zip(*.zip)|All(*.*)",0,"New Compressed (zipped) Folder.zip") It makes it a little more user friendly. Link to comment Share on other sites More sharing options...
guinness Posted May 12, 2013 Share Posted May 12, 2013 Not to mention there is a newer UDF available by wraithdu. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now