lib/file: add a `from` parameter on `write_native` and `io_write`