T
tcwarrior
Hi all. I am trying to write a little program where I extract some
data out of a game in real time. The game writes some info to a log
file, and I can access this in real time. The problem is that the log
name is (partially) new every time so I can't just open any file.
Currently I have to first start the log, then copy the log name to my c
++ source file (fopen(logname)), then compile the source file and
after that run the extracting program, at which time the log has grown
a substantial amount.
What I want to do is just start the log and then start the extracting
program and it'll find the new logfile right away.
Good to know:
I can set the first part of the name manually. The game adds date and
time to it so the logfile name is e.g.:
mylogname_070208_180914.log
I can see two ways of solving this: Either search for the newest files
in the folder the log is created in, or open a file that starts with
"mylogname".
Anyone have a solution to this?
current code:
FILE *fileP; //fileP = file pointer
fileP = fopen("mylogname_070208_172648.log","r"); //bad code have to
copy paste every time
data out of a game in real time. The game writes some info to a log
file, and I can access this in real time. The problem is that the log
name is (partially) new every time so I can't just open any file.
Currently I have to first start the log, then copy the log name to my c
++ source file (fopen(logname)), then compile the source file and
after that run the extracting program, at which time the log has grown
a substantial amount.
What I want to do is just start the log and then start the extracting
program and it'll find the new logfile right away.
Good to know:
I can set the first part of the name manually. The game adds date and
time to it so the logfile name is e.g.:
mylogname_070208_180914.log
I can see two ways of solving this: Either search for the newest files
in the folder the log is created in, or open a file that starts with
"mylogname".
Anyone have a solution to this?
current code:
FILE *fileP; //fileP = file pointer
fileP = fopen("mylogname_070208_172648.log","r"); //bad code have to
copy paste every time