anchor.diff:  
   %%%-----------------------------------------------------------------
   %%% Utility functions.
  -
  -append([I | Is], R) when is_list(R) -> append(Is, [I | R]);
  -append([], R) -> R.
  -
   
   %% Converts a list of mode atoms into a mode word for the driver.
   %% Returns {Mode, Portopts, Setopts} where Portopts is a list of 
  
positive.code:     eof;
  translate_response(?FILE_RESP_FNAME, Data) when is_binary(Data) ->
      {ok, prim_file:internal_native2name(Data)};
  translate_response(?FILE_RESP_LFNAME, []) ->
      ok;
  translate_response(?FILE_RESP_LFNAME, Data) when is_binary(Data) ->
      {append, transform_lfname(Data)};
  translate_response(?FILE_RESP_ALL_DATA, Data) ->
      {ok, Data};
  translate_response(X, Data) ->
  
negative.code:     list_dir_int(Port, Dir).
  
  list_dir_int(Port, Dir) ->
      drv_command(Port, [?FILE_READDIR, pathname(Dir)],
  		fun(P) ->
  			case list_dir_response(P, []) of
  			    {ok, RawNames} ->
  				{ok, list_dir_convert(RawNames)};
  			    Error ->
  				Error
  			end
  		end).
  
  list_dir_response(Port, Acc0) ->
      case drv_get_response(Port) of
  	{lfname, []} ->
  	    {ok, Acc0};
  	{lfname, Names} ->
  	    Acc = [Name || <<L:16,Name:L/binary>> <= Names] ++ Acc0,
  	    list_dir_response(Port, Acc);
  	Error ->
  	    Error
      end.
  
  list_dir_convert([Name|Names]) ->
      [prim_file:internal_native2name(Name)|list_dir_convert(Names)];
  list_dir_convert([]) -> [].
  
  %%%-----------------------------------------------------------------
  %%% Functions to communicate with the driver
  