I'll only be using fs.*; since io.open is basically just a wrapper for fs.open.
Look through the io API in /rom/apis/ if you want to see how it works.
Code:
Spoiler
Pastebin: http://pastebin.com/nq63aA39*Note that I'm using a screenshot; because frankly, I'm tired of the forums killing the formatting if I edit my posts :unsure:/>/>
1) Remember to close your file handles!
2) Note that with fs.open, you'll have to use filehandle.write, not filehandle:write! (or you'll get Table: 1337B33F in your file!)
3) Remember to close your file handles!
4) Yes, I know there's no space between the 0s and "digits". Might fix it later, though.
5) If you want to write multiple lines of data, you'll have to use newlines to separate them (n), as filehandle.write() doesn't automatically append one!
6) I hope this short code sample helped you, and most importantly of all:
7) Remember to close your file handles!
8) If you missed it, here's the pastebin link: http://pastebin.com/nq63aA39
9) Some more info on fs.open/fs file objects:
You can use fsfile.writeLine(text) to write and add a newline automatically.
Supported modes:
r - Read only
w - write only
a - append
b - binary (can be used in conjuction with above: rb, wb, ab)