SandelPerieanu Posted April 9, 2006 Posted April 9, 2006 FileDelete('search.txt')FileWrite('search.txt', FileSearch('C:\'))Func FileSearch($search_dir, $files = '') $old_dir = @WorkingDir FileChangeDir($search_dir) $search = FileFindFirstFile('*.*') While 1 $file = FileFindNextFile($search) If $file = '' Then ExitLoop $s_check = StringInStr(FileGetAttrib(StringReplace(@WorkingDir & '\' & $file, '\\', '\')), 'D') $full_file = StringReplace(@WorkingDir & '\' & $file, '\\', '\') Select Case $s_check <> 0 $files &= FileSearch($full_file) Case $s_check = 0 $files &= $full_file & @CRLF EndSelect WEnd FileClose($search) FileChangeDir($old_dir) Return $filesEndFunc ;==>Search ERROR:Unable to open file, the maximum number of open files has been exceeded.WHY?how many is maximum?
Valuater Posted April 9, 2006 Posted April 9, 2006 at a quick glanceFileDelete('search.txt')FileWrite('search.txt', FileSearch('C:\'))Func FileSearch($search_dir, $files = '')$old_dir = @WorkingDirFileChangeDir($search_dir)$search = FileFindFirstFile('*.*')While 1$file = FileFindNextFile($search)If $file = '' Then ExitLoop$s_check = StringInStr(FileGetAttrib(StringReplace(@WorkingDir & '\' & $file, '\\', '\')), 'D')$full_file = StringReplace(@WorkingDir & '\' & $file, '\\', '\')SelectCase $s_check <> 0$files &= FileSearch($full_file)Case $s_check = 0$files &= $full_file & @CRLFEndSelectWEndFileClose($search)FileChangeDir($old_dir)Return $filesEndFunc ;==>Searchthe function appears to be running within itself over and over8)
Developers Jos Posted April 9, 2006 Developers Posted April 9, 2006 WHY?how many is maximum?Max 64 open files... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
SandelPerieanu Posted April 10, 2006 Author Posted April 10, 2006 solved.......woks good and fast...my error.... FileDelete(@DesktopDir & '\Search.txt')FileWrite(@DesktopDir & '\Search.txt', FileSearch('C:\')) Func FileSearch($search_dir)$allfiles = ''$search_dir = StringReplace($search_dir & '\', '\\', '\')$search = FileFindFirstFile($search_dir & '*.*')While 1$file = FileFindNextFile($search)If $file = '' Then ExitLoop$full_file = $search_dir & $file$check_file = StringInStr(FileGetAttrib($full_file), 'D')If $check_file <> 0 Then $allfiles &= FileSearch($full_file)If $check_file = 0 Then $allfiles &= $full_file & @CRLFWEnd FileClose($search) Return $allfilesEndFunc ;==>FileSearch
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