You are absolutely right. My first posting was to show how to get around the problem that some simulators (e.g. Modelsim) cannot write out the NULL byte. Of course a more general solution is using $fseek(fd, -3, 1) as you pointed out.
I know NCVerilog can do this, but not all simulators work this way.
Jim