Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-09

TEventLog.FileName : Hot to do an append to existing log file

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

phoebus phoebus

Hi,

I'm not understand how to use unit Teventlog to no create each time a new file but to append to an existing log file.

I want to do something like:

  assign(f,filename);
  if FileExists(filename) then Append(f)
                          else Rewrite(f);
  Writeln(f,FormatDateTime('dd/mm/yyyy hh:nn:ss  ',Now),msg);
  CloseFile(f);

Regards,

Reply by email

Michael Van Canneyt
to phoebus phoebus
phoebus phoebus wrote 12 lines
Hi, I'm not understand how to use unit Teventlog to no create each time a new file but to append to an existing log file. I want to do something like:   assign(f,filename);   if FileExists(filename) then Append(f)                           else Rewrite(f);   Writeln(f,FormatDateTime('dd/mm/yyyy hh:nn:ss  ',Now),msg);   CloseFile(f);

This is currently not possible.
Please file a feature request in the bugtracker.

Michael.

Reply by email