SSJoco Posted November 17, 2010 Share Posted November 17, 2010 Hi! I have a little Autoit script (1200 lines). This script scan files and folders, then copy some files or start WinRAR. That's all! However after the scan and copy, all the source folders is locked. I have to close the script then delete the folder. It means the script still user this folders. I search every possible command which is use direcory, but nothing. I use FileFindFirstFile command which request Fileclose operation and I have every close commands. Any idea how can I find whick command lock the dir? Link to comment Share on other sites More sharing options...
wakillon Posted November 17, 2010 Share Posted November 17, 2010 Hi!I have a little Autoit script (1200 lines). This script scan files and folders, then copy some files or start WinRAR. That's all!However after the scan and copy, all the source folders is locked. I have to close the script then delete the folder. It means the script still user this folders. I search every possible command which is use direcory, but nothing. I use FileFindFirstFile command which request Fileclose operation and I have every close commands.Any idea how can I find whick command lock the dir?Same problem when you use it compiled ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Bert Posted November 17, 2010 Share Posted November 17, 2010 post your script so we can see what is happening The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
SSJoco Posted November 17, 2010 Author Share Posted November 17, 2010 It locks the folder both au3 and exe as well. I attached the whole script. winrar4ever() function do the main job. Lock every folder which contains *.rar file until I do not close the program. I do the same thinh with *.avi, *.nfo files, only I copy them, but it do not lock the folders. I use _Filelisttoarray only in the rar search, because I have found this command recently.WinRAR4ever.au3 Link to comment Share on other sites More sharing options...
Developers Jos Posted November 17, 2010 Developers Share Posted November 17, 2010 Had a quick glance at your code and saw at least one instance where you do not properly close a filehandle: $searchsample = FileFindFirstFile("*sample*.*") If $searchsample = -1 And FileExists($source & "\" & $rar[$b] & "\Sample") Then FileChangeDir($source & "\" & $rar[$b] & "\Sample") $searchsample = FileFindFirstFile("*.*") EndIf You want to FileClose($searchsample ) before doing another FileFindFirst(). Jos 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. Link to comment Share on other sites More sharing options...
SSJoco Posted November 17, 2010 Author Share Posted November 17, 2010 I think I've got it! I do FileFindFirstFile inside the loop, but I closed the handler after the loop. If I close the search handler at the end of the loop then it won't lock the folders. Uh, I haven't edited this program for a while. Thanks For The Help 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