anchor.diff:              file:close(OldFile)
       end,
   
  -    {ok, File, #file_info{size = Size}} = open_file(Path),
  +    {ok, File, #file_info{size = Size,
  +                          inode = Inode}} = open_file(Path),
       State#state{file = File,
  -                file_size = Size}.
  +                file_size = Size,
  +                file_inode = Inode}.
  +
  +check_log_file(#state{path = Path,
  +                      file_inode = FileInode} = State) ->
  +    case file:read_file_info(Path) of
  +        {error, enoent} ->
  +            open_log_file(State);
  +        {ok, #file_info{inode = NewInode}} ->
  +            case FileInode =:= NewInode of
  +                true ->
  +                    State;
  +                false ->
  +                    open_log_file(State)
  +            end
  +    end.
   
   open_file(Path) ->
       case file:read_file_info(Path) of
  
positive.code:           path :: string(),
            file :: undefined | file:io_device(),
            file_size :: integer(),
            buffer :: binary(),
            buffer_size :: integer(),
            flush_timer :: undefined | reference(),
  
negative.code:           batch_timeout :: pos_integer(),
            rotation_size :: non_neg_integer(),
            rotation_num_files :: pos_integer(),
            rotation_compress :: boolean(),
            rotation_check_interval :: non_neg_integer()
           }).
  
  start_link(Name, Path) ->
  