I'm working on a very, very simple Lua program, trying to teach myself the language. Here's the three line program:
file = io.open("hello.txt", "w")
file:write("Hello, World.\n")
io.close(file)
When I use the program with Lua as a script, it works fine. When I compile the program, it works. However, when I run the compiled program, I get this:
I'm using Lua 5.1.2 on Windows XP on a Pentium 4. I uninstalled Lua and re-installed it, with no effect. I'm compiling the script as follows:
luac -o hello.exe hello.lua
Am I doing something wrong, or is this a known bug? I'd like to be able to write Lua programs to run on computers without Lua installed. Help! (And thanks!)