[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [5.1.4/newbie] How to check end script?
- From: Axel Kittenberger <axkibe@...>
- Date: Mon, 7 Mar 2011 17:32:28 +0100
> Both do the job, but os.exit() will cause the process to end immediately
> without the garbage collector doing a final clean up. I found this out the
> hard way when I had some code that would flush a file and close it when the
> object was garbage collected, but calling os.exit() would leave the file in
> an inconsistent state. Doing a 'return' from the script would cause the GC
> to kick in.
I suppose you had some extra on "__gc"? I always believed the Linux
kernel will call a clean close() on all open file descriptors when
terminating a process.