BrewManNH Posted February 14, 2013 Share Posted February 14, 2013 Make sure you're not using the sort feature unless needed, that can really slow it down when dealing with large amounts of files/folders. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
z0iid Posted February 14, 2013 Share Posted February 14, 2013 my bad. i've been so inundated at work, i completely forgot I had a similar issue last year. The version of the UDF I had did not have that line. I added it to the latest version, and I'll get back to testing. z0iid,I am not really prepared to work on the UDF to meet what seems to me to be a pretty specific requirement - sorry. But it was you who had a memory problem a while ago when running the UDF on shares - are you sure that you are not running into the same problem? I never did add that "no . and .." line into the release version - perhaps it might work again? As to the time it takes - that is just the CPU share it a single AutoIt thread gets. Perhaps you could try using ProcessSetPriority to increase the CPU time the thread gets while this UDF is running. M23 Link to comment Share on other sites More sharing options...
z0iid Posted February 14, 2013 Share Posted February 14, 2013 forcing it to skip . and .. solved the problem. Down to less than 20 minutes for a full scan of the file share. I should know better by know that M23 code is top shelf and that problems i experience are user related. thanks again. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 15, 2013 Author Moderators Share Posted February 15, 2013 z0iid,Glad you got it sorted - and that my memory still works having passed 60! I should know better by know that M23 code is top shelfGosh - thanks! :> 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...
johnmcloud Posted March 8, 2013 Share Posted March 8, 2013 (edited) Melba i need a little help I'll check a folder for txt ( only the relative path ) I want to check if on another folder there is the same file ( or multiple files, don't know ), if yes delete it from array, if it's not exist don't do nothing Like: DIR1 --> File1.txt File2.txt File3.txt DIR2 --> File2.txt File3.txt Result --> File1.txt or DIR1 --> File1.txt File2.txt File3.txt DIR2 --> File4.txt Result --> File1.txt File2.txt File3.txt What is wrong with this? $Path = "C:\Test" $Path_diff = "C:\Test\Folder" $MelbaArray = _RecFileListToArray($Path, "*.txt", 1) _ArrayDisplay($MelbaArray) For $i = 1 To UBound($MelbaArray) -1 If FileExists($Path_diff & "\" & $MelbaArray[$i]) Then _ArrayDelete($MelbaArray, $i) ; <=== This is the problem, if i use ConsoleWrite i have the correct value EndIf Next _ArrayDisplay($MelbaArray) If some file are excluded, i'd like also a msgbox with the excluded filelist P.S When i have the honor to see a link to the helper on the first post? Thanks Edited March 8, 2013 by johnmcloud Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2013 Author Moderators Share Posted March 8, 2013 johnmcloud,Firstly, you do not need my UDF for this - as there is no requirement to look into subfolders, you can use _FileListToArray. Secondly, if you are deleting things from an array you need to start from the end and work up - otherwise you run into index problems as the loop will run for the original size while the array will become a smaller size after any deletion. This works for me:#include <File.au3> #include <Array.au3> $sPath = "N:\Test\Folder_1" $sPath_diff = "N:\Test\Folder_2" $aMainArray = _FileListToArray($sPath, "*.txt", 1) _ArrayDisplay($aMainArray) For $i = UBound($aMainArray) - 1 To 1 Step -1 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< If FileExists($sPath_diff & "\" & $aMainArray[$i]) Then MsgBox(0, "Deletion", $aMainArray[$i] & " removed from array") _ArrayDelete($aMainArray, $i) $aMainArray[0] -= 1 EndIf Next _ArrayDisplay($aMainArray)All clear? M23P.S. I will look at the helper GUI again later today - thanks for the reminder. 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...
johnmcloud Posted March 8, 2013 Share Posted March 8, 2013 (edited) In my script i have subfolder, but i have removed from example so i need your udf Only one thing, is possible to have only one msgbox with all the list? Like: File excluded are: 1.txt 2.txt 3.txt Thanks Edited March 8, 2013 by johnmcloud Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2013 Author Moderators Share Posted March 8, 2013 johnmcloud, Easy! You have a think about how you might do it based on that code above - and if you have not come up with a solution after I have eaten lunch I will tell you then, as long as you have some code to show me! 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...
Moderators Melba23 Posted March 8, 2013 Author Moderators Share Posted March 8, 2013 (edited) johnmcloud,One small change that I would like to see in that GUI before you finish, please. As it stands there could be some confusion as to whether the checkboxes include or exclude the hidden/system/link items - at the moment you need to check the boxes to omit the items, which seeems a little illogical to me. I would suggest an additional line above the checkboxes: "Omit special items" - then it is obvious what checking the boxes will do. M23Edit: And as you have worked so hard on that GUI - here is how to get a single MsgBox in that earlier script. #include <File.au3> #include <Array.au3> $sPath = "N:\Test\Folder_1" $sPath_diff = "N:\Test\Folder_2" $aMainArray = _FileListToArray($sPath, "*.txt", 1) _ArrayDisplay($aMainArray) $sDeleted = "" ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $i = UBound($aMainArray) - 1 To 1 Step -1 If FileExists($sPath_diff & "\" & $aMainArray[$i]) Then $sDeleted &= $aMainArray[$i] & @CRLF ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< _ArrayDelete($aMainArray, $i) $aMainArray[0] -= 1 EndIf Next _ArrayDisplay($aMainArray) MsgBox(0, "Deleted", $sDeleted) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Edited March 8, 2013 by Melba23 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...
johnmcloud Posted March 8, 2013 Share Posted March 8, 2013 (edited) Melba i have update the code with your suggestion, now the checkbox work as the opposite as before ( check = exclude ) and i have add the Omit special items ( if is checked = omit all, i have make it unclickable because is based on status of other checkbox ), hope i have make everything well Now i'll check it out your code "exclude from array" Edited March 8, 2013 by johnmcloud Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2013 Author Moderators Share Posted March 8, 2013 johnmcloud,I am afraid I find that even more confusing than before. What I meant was something like this:#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateLabel("--------------------------------------------------------------------------------------------", 10, 100, 200, 20) GUICtrlCreateLabel("Omit special items", 10, 120, 200, 20) GUICtrlCreateCheckbox(" Hidden files/folders", 10, 140, 120, 20) GUICtrlCreateCheckbox(" System files/folders", 150, 140, 120, 20) GUICtrlCreateCheckbox(" Junction/Link folders", 10, 160, 120, 20) GUICtrlCreateLabel("--------------------------------------------------------------------------------------------", 10, 180, 200, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndNow it seems clear to me that checking the checkboxes will omit the relevant items and you need to add a value to the parameter. Dos that make it clearer to you as well? 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...
johnmcloud Posted March 8, 2013 Share Posted March 8, 2013 LOL, sorry Melba. I have add a Group to the "omit parameter" and i have removed the new checkbox. By default the checkbox are checked, so if you want to omit you need to clear it Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2013 Author Moderators Share Posted March 8, 2013 johnmcloud,Now the logic is completely backwards! Title says: Omit special itemsWith all checked => _RecFileListToArray("M:ProgramAu3 Scripts", "*") - everything includedWith none checked = _RecFileListToArray("M:ProgramAu3 Scripts", "*", 0 + 4 + 8 + 16) - everything excludedBut if you change "Omit special items" to "Include special items" and have them all checked by default I think you are there! 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...
johnmcloud Posted March 8, 2013 Share Posted March 8, 2013 Ok, now i'm sure is correct Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2013 Author Moderators Share Posted March 8, 2013 johnmcloud,That still gives the same result. As I suggested above, leave the logic alone and change the title of the group as I suggested above to "Include" - and have all 3 checked by default so that becomes the default setting. And when we are all happy I will break out all the GUI posts into another thread. 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...
johnmcloud Posted March 8, 2013 Share Posted March 8, 2013 (edited) Someone kill me or give me an english teacher lol. Sorry but: Hidden/Link/System ALL UNCHECKED --> _RecFileListToArray("C:", "*", 0 + 4 + 8 + 16) Hidden/Link/System ALL CHECKED --> _RecFileListToArray("C:", "*") This is the correct way, or not? If it's not i'll surrender and do what you suggest Edited March 8, 2013 by johnmcloud Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2013 Author Moderators Share Posted March 8, 2013 johnmcloud.If the title says "Omit" then checking the boxes should add the additional parameters to exclude the items - as you show above the opposite happens. So just change the title to "Include" and have them all checked by default as I keep suggesting (this is the third time), Then when the checkboxes are unchecked, the additional parameters will be added and the items will be omitted. Are we finally on the same page? 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...
johnmcloud Posted March 8, 2013 Share Posted March 8, 2013 I hope this this time is the right time, i have change the title to Include as you suggested three times, the checkbox are checked by default at startup So, title is "include" Checkbox checked --> _RecFileListToArray("C:", "*") Checkbox unchecked --> _RecFileListToArray("C:", "*", 0 + 4 + 8 + 16) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2013 Author Moderators Share Posted March 8, 2013 johnmcloud, 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...
johnmcloud Posted March 8, 2013 Share Posted March 8, 2013 Yeah I really need to improve my english I have forget to say, i have test the "exclude from array" script and working fine, thanks Link to comment Share on other sites More sharing options...
Recommended Posts