This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Dejected's profile picture

Help With Reading File

Started by Dejected, 20 September 2013 - 12:40 PM
Dejected #1
Posted 20 September 2013 - 02:40 PM
I try to run this program

if not fs.exists("SIDE") then
  write("What side is your door on?")
  side = read()
  local file = io.open("SIDE","w")
  file:write(side)
  file:close
  shell.run("setTime")
else
  shell.run("setTime")
end
and it gives me this error

bios:337: [string "setSide"]:7: function arguments expected

Can someone please help?
Dejected #2
Posted 20 September 2013 - 02:49 PM
WOW. nevermind sorry I didnt see that i was missing parenthesis on the file:close