0

I'm using Pantheios in my application and I'd like to generate a new log file each hour. I've seen the blog entry that explains how to add the date and time (http://blog.pantheios.org/2010/10/pantheios-101-beta-197-released-befile.html) using, for example:

pantheios_be_file_setFilePath("test-%T-%D.log");

where The %T specifier is replaced by the current time, in the format HHMMSS. The %D specifier is replaced by the current date, in the format YYYYMMSS.

The example above would create a unique file each minute. My question is whether it's possible have a file created every hour. I've tried using %H and %HH but neither works. Thanks in advance for any help.

user399540
  • 269
  • 1
  • 4
  • 7

1 Answers1

0

Your question is a bit incorrect.

The example above would create a unique file each minute.

Why do you think so? By using function pantheios_be_file_setFilePath(), you can just set a unique name for your log file and nothing more (not a periodically call to create a new file). If I missed something, correct me, but there isn't any lines of code, which create a new file each minute. If you want so, create a thread with a timer.

BTW, you can't set something differ from %T or %D, because of next lines from bec.file.cpp:1050:

// date format: YYYYMMDD
// time format: hhmmss

pan_char_t const* const date    =   pan_strstr_(fileName, PANTHEIOS_LITERAL_STRING("%D"));
pan_char_t const* const time    =   pan_strstr_(fileName, PANTHEIOS_LITERAL_STRING("%T"));

size_t const            nameLen =   pan_strlen_(fileName);

As you can see, there is only two symbols, that could be parsed. No any %H or %HH.

Sergei Danielian
  • 4,938
  • 4
  • 36
  • 58