51
Mach4 General Discussion / Lua file operations
« on: March 24, 2018, 09:31:04 AM »
Hoping for some help on basic file operations in Lua.
Is there a reference for how to modify the code for file operations from the lua.org/manual information to get it to work in Mach4Lua?
It does not seem to recognize the io.write and io.code but recognized io.open
Here is the simple version I am trying.
Thanks!
Is there a reference for how to modify the code for file operations from the lua.org/manual information to get it to work in Mach4Lua?
It does not seem to recognize the io.write and io.code but recognized io.open
Here is the simple version I am trying.
Code: [Select]
inst = mc.mcGetInstance()
local profile = mc.mcProfileGetName(inst)
local path = mc.mcCntlGetMachDir(inst)
stuff="--one,two,three"
filetoget=path .. "\\testfile.csv"
io.output=io.open(filetoget,"a+")
io.write(stuff)
io.close()
Thanks!