io - Creating new files with Lua I/O functions -
I'm starting to learn about the IO function, and am trying to implement them in my code I have searched the answer and nothing is clear Yes or no, or at least I do not see one. I am hoping someone will know the answer here and will be able to help with it.
I am planning to create a text file which I can write in the form of time progression. It will basically be a log for which I will put lines of output. Obviously io.open ("textfile.txt") does not make a file, or it appears.
Is there a way to create a text file in Leah that IO.read/ write later? Additionally, do I need to call io.close () before opening or creating a new text file? I appreciate any help thank you!
You must open the file as write as follows: F = io.open ("textfile.txt", "W") . Then use
: f: write () to write stuff to it. When finished, call
f: close () .
Comments
Post a Comment