Writes all of data at offset; the file's position does not move.
Io :: #import "Extensions/Io";
#import "File";
Io.io_run(() {
file, _ := Io.open_file("/tmp/jacket-io-write-at.txt", .READ_WRITE);
defer Io.close(*file);
Io.write_at(*file, "abcdef", 0);
Io.write_at(*file, "XY", 2);
data, _ := Io.read_file("/tmp/jacket-io-write-at.txt");
assert(cast(string) data == "abXYef");
free(data.data);
});
file_delete("/tmp/jacket-io-write-at.txt");Doesn't run in the browser (only on linux, macos).
write_at :: (file: *Io_File, data: [] u8, offset: s64) -> (s64, Io_Error)
Parameters
- file: *Io_File
- data: [] u8
- offset: s64
Returns
- s64
write_at :: (file: *Io_File, text: string, offset: s64) -> (s64, Io_Error)
The write_at for a string.
Parameters
- file: *Io_File
- text: string
- offset: s64
Returns
- s64