Skip to content
Xen / docs

Search documentation

English · v0.1.0-demo.2

Type to search the documentation.

    한국어
    Xen / reference v0.1.0-demo.2

    File (legacy)

    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.