myspacee Posted December 2, 2008 Share Posted December 2, 2008 hello, use FileFindFirstFile to return list of directories on given path. all works fine, util directories names are in this format : SS.F70824 SS.F70825 SS.F70826 SS.F70827 SS.F70828 SS.F70829 .. Dot (SS.) in directories name, brokes all script engine, and can't resolve. Is there a way to list all directory also in this format ? (can't touch them, as part of production cicle) Thank you, m. Link to comment Share on other sites More sharing options...
bourny Posted December 2, 2008 Share Posted December 2, 2008 hello, use FileFindFirstFile to return list of directories on given path. all works fine, util directories names are in this format : SS.F70824 SS.F70825 SS.F70826 SS.F70827 SS.F70828 SS.F70829 .. Dot (SS.) in directories name, brokes all script engine, and can't resolve. Is there a way to list all directory also in this format ? (can't touch them, as part of production cicle) Thank you, m. I tested the following and it works for me - c:\ mb contains directories you named above [/code] ; Shows the filenames of all files in the current directory.#' #include <array.au3> ; Shows the filenames of all files in the current directory.#' #include <array.au3> Dim $DirListing[1] $search = FileFindFirstFile("C:\mb\*.*") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop _ArrayAdd($DirListing, $file) WEnd ; Close the search handle FileClose($search) _ArrayDisplay($DirListing) [code] Link to comment Share on other sites More sharing options...
rasim Posted December 2, 2008 Share Posted December 2, 2008 myspaceeCan you make a small example to duplicate this problem? Link to comment Share on other sites More sharing options...
myspacee Posted December 2, 2008 Author Share Posted December 2, 2008 my for example:in c:\mb\ i've these folders and some files...SS.F70824SS.F70825SS.F70826SS.F70827SS.F70828SS.F70829goofy.pdfgoofy.inidonald.pdfdonald.inineed to list only directories (need directory name for script), but SS. give me some problem (not recognized as directory)bourny thank you for script but array contains also filenames, i need only directories name.thank you both,m. Link to comment Share on other sites More sharing options...
Andreik Posted December 2, 2008 Share Posted December 2, 2008 (edited) my for example:in c:\mb\ i've these folders and some files...need to list only directories (need directory name for script), but SS. give me some problem (not recognized as directory)bourny thank you for script but array contains also filenames, i need only directories name.thank you both,m.Use _FileListToArray($sPath,"*",2). Edited December 2, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
zorphnog Posted December 2, 2008 Share Posted December 2, 2008 Try this: #include <array.au3> Dim $DirListing[1] $search = FileFindFirstFile("C:\mb\*") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop If StringInStr(FileGetAttrib("C:\mb\" & $file), "D") <> 0 Then _ArrayAdd($DirListing, $file) WEnd ; Close the search handle FileClose($search) _ArrayDisplay($DirListing) Link to comment Share on other sites More sharing options...
myspacee Posted December 2, 2008 Author Share Posted December 2, 2008 zorphnog, tricky but perfect. m. Link to comment Share on other sites More sharing options...
myspacee Posted January 20, 2009 Author Share Posted January 20, 2009 sorry to retake this post. Working again with FileFindFirstFile() and directory i've this structure : c:\A\ c:\A\1\lion.txt c:\A\1\cat.txt c:\A\1\dog.txt c:\A\2\lemon.txt c:\A\2\banana.txt c:\A\3\autoit.txt try to write script that scan sub-directory and return files one by one with no luck. Anyone can help ? m. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 20, 2009 Moderators Share Posted January 20, 2009 myspacee, Here is a recursive search script which will get all files in a tree of folders. All you need to do is substitute the start (top level) folder and the filename (*.* for everything). 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...
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