Do NOT write to file unless there is absolutely no other option.
Otherwise you will be load-testing the I/O rate of the load generator.
Try storing the contents in a LR parameter instead.
The easiest way would be to use a datetime parameter or the function
lr_save_datetime (which are basically a wrapper around the strftime
function).
Use the setlocale function once to make a datetime parameter,
lr_save_datetime, asctime, ctime and strftime operate in the language
of your choosing (like %A) instead of the locale of the OS on the load
generator / Vugen.
For standard C functions (those without a '_') it is better to
reference sites dedicated to the C/C++ language, such as
www.cplusplus.com,
because the "HP LoadRunner Online Function Reference" is for standard
C functions often incomplete and sometimes incorrect.
(
http://www.cplusplus.com/reference/clibrary/ctime/strftime/ )
@Kevyland: don't duplicate constants, use the operator sizeof instead.
Note: if you must write to a file then put the fopen in vuser_init and
fclose in vuser_end. This will help to keep the I/O overhead low.
André