Jump to content
Sign in to follow this  
wysocki

Downside of leaving things "open"?

Recommended Posts

wysocki

I'm careful about closing whatever I open in Auto-It with things like fileopen(), _FTP_Open(), _FTP_Connect, FindFindFirstFile(), etc.

But what is the effect of accidentally (or purposely) exiting the program without specifically closing those files or handles? Is it all cleaned up when my script closes or when Windows restarts or what????

Share this post


Link to post
Share on other sites
Tvern

AutoIt3 will cleanup all open handles for you when the script exits.

Jos :)

That is, if it exits properly. Crashing scripts which had files open have resulted in "locked" files for me in the past (AutoIt 3.2.x), although not always. (windows trying to clean up after you?)

Rebooting would free up the files again.

Share this post


Link to post
Share on other sites
Jos

That is, if it exits properly. Crashing scripts which had files open have resulted in "locked" files for me in the past (AutoIt 3.2.x), although not always. (windows trying to clean up after you?)

Rebooting would free up the files again.

This is always true with any Application when talking about a hardcrash.

When a script soft crash happens, handles will still be freed properly.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
trancexx

Locked by what? If your app crashed or whatever and no longer exists how can it keep something locked?

(There are some special cases that I can think when this is possible to happen, but to be happening with AutoIt, I'm not sure)


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Tvern

Locked by what? If your app crashed or whatever and no longer exists how can it keep something locked?

(There are some special cases that I can think when this is possible to happen, but to be happening with AutoIt, I'm not sure)

I'm not sure if locked is the right term, but on a certain application I made, I often found I couldn't delete some files in the test folder. These where just simple textfiles the application made.

It could have been caused by hard crashes as I have experienced a few of those, which would also explain why non all crashes caused that behavior.

Edit: just to clarify, I havn't seen this in 3.3.6.1. I believe I was using 3.2.12 back then.

Edited by Tvern

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×