[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: File descriptors and local variables
- From: Paul K <paulclinger@...>
- Date: Mon, 4 Nov 2013 23:11:19 -0800
Hi All,
I've written on several occasions something that looks like this:
local exists = io.open("/somefile") ~= nil
What happens to the returned file handle in those cases when
"/somefile" exists? The documentation states that the file is closed
when the handle is garbage collected after going out of scope, but
does it go out of scope immediately (as it's not assigned to anything)
or only after reaching the "end" statement for the current scope?
Thank you.
Paul.