eJan Posted July 11, 2005 Posted July 11, 2005 AutoIt 3.1.1.56Fixed : FileFindFirstFile does not return anymore "." or "..".First run and everything works fine with script /FileFindNextFile/:#NoTrayIcon ; Shows the filenames of all files in the current directory $search = FileFindFirstFile(@ScriptDir & "\Favorites\*.*") ; Check if the search was successful 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 MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileClose($search)Then I run this one with Favorites.rar:$search = FileFindFirstFile(@ScriptDir & "\Favorites\*") 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 $file > "001" Then DirRemove(@ScriptDir & "\Favorites\001", 1) FileClose($search) Exit EndIf WEnd FileClose($search) DirRemove(@ScriptDir & "\Favorites", 1)and...Then I try the first one with empty "Favorites" folder and...Is this in my script or [Fixed : FileFindFirstFile does not return anymore "." or "..".]?
Lazycat Posted July 12, 2005 Posted July 12, 2005 (edited) Edit: forgot what I say before Actually your script is crashes when removing dir, but when doing search of empty forlder returns some junk. So that is bug. Edited July 12, 2005 by Lazycat Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
jpm Posted July 12, 2005 Posted July 12, 2005 FindFindFirstfile on empty dir corrected in 3.1.1.57 But not sure what is the remove crashing. can you highlight when it occurs?
eJan Posted July 12, 2005 Author Posted July 12, 2005 (edited) Thanks jpm, I'm gonna try it right now.EDIT:FindFindFirstfile on empty dir corrected in 3.1.1.57But not sure what is the remove crashing.can you highlight when it occurs?It occurs only in 3.1.1.56 when i run the script several times again, the error could be in my script but I cannot find the good way to finish it. Maybe some help, I'd like to check if folder contain 001 and some file with it, if yes then delete only 001, else remove complete $search dir (@ScriptDir & "\Favorites").$search = FileFindFirstFile(@ScriptDir & "\Favorites\*") 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 $file > "001" Then DirRemove(@ScriptDir & "\Favorites\001", 1) FileClose($search) Exit Else DirRemove(@ScriptDir & "\Favorites", 1) FileClose($search) Exit EndIf WEnd FileClose($search) Edited July 13, 2005 by eJan
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