nodemcu-firmware/lua examples/myfile.lua

13 lines
234 B
Lua
Raw Normal View History

2014-11-23 17:30:49 +01:00
--myfile.lua
local myfile = {}
function myfile.print(name)
file.open(name)
repeat
local line=file.readline()
if line then line=(string.gsub(line,"\n","")) print(line) end
until not line
file.close()
end
return myfile