Jump to content

Search the Community

Showing results for tags 'array contains search handle'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. In the search function, which I saw on >this page has a drawback: the files are added to the list in reverse order. So I made a function that caches a search handle instead of path. Local $FileList = '' $timer = TimerInit() _FileSearch(@WindowsDir, $FileList) MsgBox(0, "Time", 'Time : ' & Round(TimerDiff($timer) / 1000, 2) & ' sec') $file = FileOpen(@ScriptDir & '\file.txt', 2) FileWrite($file, $FileList) FileClose($file) Func _FileSearch($sPath, ByRef $FileList) If StringRight($sPath, 1) <> '\' Then $sPath &= '\' If Not FileExists($sPath) Then Return SetError(1, 0, '') If StringInStr($sPath, '/') Then Return SetError(1, 0, '') Local $hSearch, $c = 0 $hSearch = FileFindFirstFile($sPath & "*") If $hSearch = -1 Then Return SetError(3, 0, '') Local $aSearchList[125][2] = [[$hSearch, $sPath]], $sName Do $sPath = $aSearchList[$c][1] $sName = FileFindNextFile($aSearchList[$c][0]) If @error Then FileClose($aSearchList[$c][0]) $c -= 1 ContinueLoop EndIf If @extended Then $c += 1 $aSearchList[$c][1] = $sPath & $sName & "\" $aSearchList[$c][0] = FileFindFirstFile($aSearchList[$c][1] & "*") ContinueLoop Else $FileList &= $sPath & $sName & @CRLF EndIf Until $c < 0 $FileList = StringTrimRight($FileList, 2) If Not $FileList Then Return SetError(3, 0, '') EndFunc ;==>_FileSearch
×
×
  • Create New...