anchor.diff:      %% and rename the old log as "Filename ++ Suffix". Suffix is a date marker.
       %% XXX is there a mktemp() available in Erlang?
       TmpFile = Filename ++ Suffix ++ ".rotate",
  -    case catch safe_open(TmpFile, [append]) of
  +    case catch safe_open(TmpFile, ?FILE_OPTS) of
           {ok, NewIoDev} ->
   	    %% Try to rename the old logfile
   	    case file:rename(Filename, Filename ++ Suffix) of
  
positive.code: %% Returns : string() 
  %%--------------------------------------------------------------------
  create_filename_time_suffix() ->
      {Megasec, Sec, USec} = now(),
      DateTime = util:sec_to_date(Megasec * 1000000 + Sec),
      [Date, Time] = string:tokens(DateTime, " "),
      Suffix = "-" ++ Date ++ "_" ++ Time,
  
negative.code: 	    ok;
  	Size ->
  	    %% Set up a timer to do the size checking every 60 seconds
  	    {ok, _T} = timer:send_interval(60 * 1000, logger, {check_logfile_size, Size})
      end,
      %% Construct log filenames and open/create them
      DebugFn = lists:concat([Basename, ".debug"]),
      NormalFn = lists:concat([Basename, ".log"]),
      ErrorFn = lists:concat([Basename, ".error"]),
      {ok, DebugIoDevice} = safe_open(DebugFn, ?FILE_OPTS),
      {ok, NormalIoDevice} = safe_open(NormalFn, ?FILE_OPTS),
      {ok, ErrorIoDevice} = safe_open(ErrorFn, ?FILE_OPTS),
      {ok, #state{debug_iodev=DebugIoDevice, debug_fn=DebugFn,
  		normal_iodev=NormalIoDevice, normal_fn=NormalFn,
  		error_iodev=ErrorIoDevice, error_fn=ErrorFn}}.
  