Jump to content

Downside of leaving things "open"?


wysocki
 Share

Recommended Posts

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????

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Developers

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

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

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...