Module io_file
File I/O (C11 <stdio.h> wrappers) Handles are '&File' references to an opaque type (the C FILE underneath is never exposed); File::open returns '?&File', null on failure. Operations are methods on the handle: f.read(buf), f.write(buf) (byte slices), f.seek(off, whence), f.close(), ... File conforms to io_traits.h's SeekableStream (Reader, Writer, Seekable) and Flusher, so read_exact, write_all, copy_stream, stream_size and io_buf.h's BufReader / BufWriter work on it.
Structs
| File |
Functions
| file_open | Kept for std/ml until its refactor moves to the methods above; forward to File::open() / f.close() / f.read() / f.write() / f.seek() / f.tell() / f.size(). file_read / file_write keep their old unsigned results (an error reads as 0 bytes). |
| file_close | Closes *f in place (File::open hands out references, not owned values). |
| file_read | |
| file_write | |
| file_seek | |
| file_tell | |
| file_size |