I was trying to overwrite bytes in file. My code:
class Main {
static function main() {
var tst = sys.io.File.update("/home/clintflames/WORKDIR/Projects/haxe/scal/test.txt");
tst.prepare(4);
tst.writeBytes(haxe.io.Bytes.ofString("TEST"), 2, 4);
}
}
test.txt:
qwertyuiop
I expected text.txt will turn into this:
qwTESTuiop
But i got error:
Uncaught exception: OutsideBounds
Called from sys.io.FileOutput.writeBytes(/usr/share/haxe/std/hl/_std/sys/io/FileOutput.hx:41)
Called from $Main.main(Main.hx:5)
Called from .init(?:1)