Xen / reference v0.1.0-demo.2
File (legacy)
This topic is not available in the selected language or version. Showing the start of this section.
APIs documented for this release.
open_read(path) and open_write(path) create a File. open_write creates or overwrites. On a mutable File, read() reads from the current position to the end, and write(text) writes at the current position. close() closes it and can be called repeatedly. is_open() reports its state. Files are move-only and close when leaving scope. Failures terminate the program, so prefer std.fs and std.io in new code that needs to handle failures. File has no seek or append methods.