CGAnimator Posted November 3, 2006 Posted November 3, 2006 hi there My script creates some files in the temp dir so he get some information from them later. after a while they don't have any use. my problem is sometimes windows or cleaning prog (like CCleaner) deletes those files. can i make those files in use by my autoit script ?! i mean if some one or a program is trying to delete those files rename theme the windows refuse because it's in use by another application (my script). and it'll be cool if it dos'nt take much of my computer resources.
cppman Posted November 3, 2006 Posted November 3, 2006 $hFile = FileOpen($file) then when you don't need it FileClose($hFile) maybe....? Miva OS Project
CGAnimator Posted November 3, 2006 Author Posted November 3, 2006 WOW that must be the fastest replay i get in my life thanx man, realy thanx . i'll try that and then ask another stupid Q .
CGAnimator Posted November 4, 2006 Author Posted November 4, 2006 it works just fine thanx it takes a lot of resources if you put it in a loop , I tryed "sleep" and it's kinda fair now thanx
Fossil Rock Posted November 4, 2006 Posted November 4, 2006 I don't think you need any sort of sleep. Just make a simple gui with buttons to select the file you want then a button to either open or close it. I'm not sure but I think the file will remain open even if you close the script. That way you could open the file, close the script and no cycles are used at all on it. You could then restart your script to close the file. Just an Agreement is not necessary - thinking for one's self is!
theguy0000 Posted November 4, 2006 Posted November 4, 2006 I don't think you need any sort of sleep. Just make a simple gui with buttons to select the file you want then a button to either open or close it.I'm not sure but I think the file will remain open even if you close the script. That way you could open the file, close the script and no cycles are used at all on it. You could then restart your script to close the file.Just an no, it automatically closes the file on exit. The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
CGAnimator Posted November 4, 2006 Author Posted November 4, 2006 no, it automatically closes the file on exit.That's right theguy0000 ...when the script closes autoit automatically proceed a (FileClose) function.
cppman Posted November 5, 2006 Posted November 5, 2006 it works just fine thanx it takes a lot of resources if you put it in a loop , I tryed "sleep" and it's kinda fair now thanx Your not putting the code I gave you in a loop are you?? $hFile = FileOpen("myfile.ext", 0) while (true) ;Do something while file is in use. wend FileClose($hFile) Miva OS Project
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