anchor.diff:  %%    [file:out-of-range] is raised if $offset is negative, or if it exceeds 
   %%       the current file size.
   %%    [file:io-error] is raised if any other error occurs.
  -write_binary(Ctx,File,Value) ->
  -   write_binary(Ctx,File,Value,?intv(0)).
  -
  -write_binary(_, File, ?bin(Value), Offset) when is_binary(File),
  -                                                is_integer(Offset) ->
  +write_binary(_, File, ?bin(Value)) when is_binary(File) ->
  +   % truncate the file if possible when no offset
      case file:open(File, [write,binary]) of
  -      {ok,Fd} ->
  -         case file:position(Fd, Offset) of
  -            {ok,_} ->
  -               case catch io:put_chars(Fd, Value) of
  -                  ok ->
  -                     _ = file:close(Fd),
  -                     [];
  -                  _ ->
  -                     _ = file:close(Fd),
  -                     err_io_error(File)
  -               end;
  -            {error,einval} ->
  -               err_out_of_range(Offset)
  +      {ok, Fd} ->
  +         try
  +            ok = file:write(Fd, Value),
  +            []
  +         catch
  +            _:_ ->
  +               err_io_error(File)
  +         after
  +             file:close(Fd)
            end;
         {error,eisdir} ->
            err_is_dir(File);
  
positive.code: %% Error Conditions
  %%    [file:no-dir] is raised if $path does not point to an existing directory.
  %%    [file:io-error] is raised if any other error occurs.
  children(Ctx,Dir) ->
     list(Ctx,Dir,?bool(false),?str(<<"*">>)).
  
  %% 5.4 file:path-to-native
  %% Signature
  
negative.code:             {ok,Str} ->
                 _ = file:close(Fd),
                 ?str(Str);
              eof ->
                 _ = file:close(Fd),
                 ?str(<<>>);
              X ->
                 _ = file:close(Fd),
                 ?dbg("X",X),
  