anchor.diff:  	    write_piece_data(Remaining, Rest, NS)
       end.
   
  -read_piece(PieceNum, S) ->
  -    FilesToRead = dict:fetch(PieceNum, S#state.file_dict),
  -    {ok, Data, NS} = read_pieces_and_assemble(FilesToRead, [], S),
  -    {reply, {ok, Data}, NS}.
  -
  -write_piece(PieceNum, Data, S) ->
  -    FilesToWrite = dict:fetch(PieceNum, S#state.file_dict),
  -    {ok, NS} = write_piece_data(Data, FilesToWrite, S),
  -    {reply, ok, NS}.
   
   remove_file_process(Pid, Dict) ->
       erase_value(Pid, Dict).
  
positive.code: stop(Pid) ->
      gen_server:cast(Pid, stop).
  
  %%====================================================================
  %% gen_server callbacks
  %%====================================================================
  
negative.code: %%--------------------------------------------------------------------
  %%% Internal functions
  %%--------------------------------------------------------------------
  create_file_process(Path, S) ->
      {ok, Pid} = file_process:start_link(Path),
      NewDict = dict:store(Path, Pid, S#state.file_process_dict),
      {ok, Pid, S#state{ file_process_dict = NewDict }}.
  
  