Jump to content




io.output


  • You cannot reply to this topic
2 replies to this topic

#1 civilwargeeky

  • Members
  • 393 posts

Posted 21 February 2013 - 03:56 PM

Ok. So this topic is probably more for the desktop version of lua, but it could have some applications in computercraft for me as well.

So, from what I understand (Please correct me if I'm wrong), that in lua, when you're opening it from cmd, the standard output is the terminal window, and in the Lua Reference Manual, it says that I can change the output of the program to something else (e.g. a text file).
Spoiler
What I tried to do in a program, is make it redirect the feedback from windows functions (using os.execute) to a throwaway file, then redirect to the standard output when done. However, when I tried it, it didn't really work. As in, it didn't change the output at all. Could someone please explain this to me?

Important Code:
Spoiler


#2 ChunLing

  • Members
  • 2,027 posts

Posted 21 February 2013 - 11:57 PM

Because of how io is sandboxed, not all io functions are enabled (io.open() can be used for handling files).

#3 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 22 February 2013 - 02:42 AM

This forum is about ComputerCraft with Lua, not desktop Lua I'm afraid.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users