Hi Keith,
My problem has been that the methods in the lua docs sometimes don't work with Mach4 Lua
I haven't encountered that. Certainly Mach4 uses version 5.2 and there are differences between 5.1 and 5.3 which will trip you up, I had a problem because I was looking at 5.3 docs and took me a while
to figure out why nothing worked.
The other thing is that all of chapter 6 in the 5.2 docs is about Lua 'Standard Libraries'. So all the file functions you are experimenting with are a library, not core Lua. The Library is constructed as a table.
In this case the table is called 'io'. io.open and io.close and io.flush are all entries of the table io, the entry is a function which is a very clever use of the principle of 'functions as a first class values'.
Given that a library is an addon its quite possible that certain features don't work as advertised although I haven't found any which don't comply to 5.2 docs.
Craig