lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 02/18/2011 06:53 AM, Gilles Ganault wrote:

	I'm trying to create a text file, and google for samples on how to
do this, but regardless of using a global or local variable to hold
the file descriptor, I get the following error:

"attempt to index global 'file' (a nil value)"
"attempt to index local 'file' (a nil value)"

Here's the script:

--file = ('/var/tmp/myfile.txt',w)
local file = ('/var/tmp/myfile.txt',w)



What am I doing wrong?

I'll piggy-back on this question to ask what the difference is between
"io.stdin:read()" and "".

Thank you.

You probably meant file:write("Blah") with two double quotes right?-Patrick