Sorry, I didn't answer your real questions…
- How do I access a file via the integrated API? How does the path have to look?
I'm not sure but the path is more like Unix then anything else. So what is "\folder\subfolder\myfile" in Windows, it's "folder/subfolder/myfile" here.
How to access a file? You can use either the IO or the FS API (don't get me wrong, Lua is case-sensitive, and something like FS.open would make it throw "attempt to index nil"s like mad…) I prefer using FS API, only because it's easier, and it's implemented for ComputerCraft. You can open a file in three two modes, for reading and for writing. The second argument passed to fs.open is the mode, so "w" means "Hey, FS, open this file in write mode!", and, of course, "r" means read mode. There is a third mode, called append mode, which is something like write mode. The only difference is, while in write mode, the original content of the output file gets lost, append continues writing the file where it had finished writing last time.
You can open files in binary mode with adding a "b" to the mode argument. So binary write mode is "wb", binary read mode is "rb", and binary append mode is "ab".
As I mentioned before, when you call fs.open, you get a file handle. The methods of this handle are the following:
In read mode:
handle.readLine: Reads and returns the next line of the file. Returns nil if no lines left.
handle.readAll: Reads the whole file, and returns it. This method doesn't exist in binary mode.
handle.read (only in binary mode): Reads only ONE byte and returns it. (The return value is a number between 0 and 255.)
In write or append mode:
handle.writeLine: Writes text into a new line in the file.
handle.write: Writes text to the file.
handle.write (in binary mode): Writed only ONE byte to the file. (The argument must be a number between 0 and 255.)
And of course there is handle.close, but that's self-explaining.
You can learn more here.