Re: Lua Basics: file opens and the colon?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Lua Basics: file opens and the colon?
- From: Rici Lake <lua@...>
- Date: 2005年8月29日 15:18:48 -0500
On 29-Aug-05, at 2:51 PM, William Trenker wrote:
Is the following an acceptable use of the colon with io functions?
kernelinfo = io.open("/proc/version"):read()
machinetype = io.popen("uname -m"):read()
yes
I just want to be sure that this won't leave a file handle or related
resources dangling.
The garbage collector will deal with it eventually, which is probably
good enough.