I have a large number of simultaneous logs being generated. One for each machine it's connected to. However, It seems that the log file naming scheme is fixed per the way it's setup with the logging intervals. Because we have so many different log files with the same name (but in different directories) it's been requested to modify the file names to insert an identifier. My decision is to make the 7th and 8th name characters the identifier. My assumption is that I can't change the name of the active log file.
I already have working code to extract the file name and build it back up with the identifier, but I'm not exactly sure how to sort through the logging directory and change all the right files, while not accidentally changing the active log file.
I figured that FindFileFirst and FindFileNext would spit everything out in alphabetical order, but it isn't doing that. It's mostly alphabetical, with some files jumbled around. Do any of you know what order it lists files in? Alternatively, is there a way to read back from the data station plus, what the active log file names are? Then I could scan through the whole directory and skip the active one.
I thought about just serially searching back in date order to find the files after the newest, but then how would I know when to stop without putting in some magic numbers.
It's a shame the system functions aren't documented that well in the function reference manual. Like what is OpenFile supposed to return if it's given a bad file name?
I already have working code to extract the file name and build it back up with the identifier, but I'm not exactly sure how to sort through the logging directory and change all the right files, while not accidentally changing the active log file.
I figured that FindFileFirst and FindFileNext would spit everything out in alphabetical order, but it isn't doing that. It's mostly alphabetical, with some files jumbled around. Do any of you know what order it lists files in? Alternatively, is there a way to read back from the data station plus, what the active log file names are? Then I could scan through the whole directory and skip the active one.
I thought about just serially searching back in date order to find the files after the newest, but then how would I know when to stop without putting in some magic numbers.
It's a shame the system functions aren't documented that well in the function reference manual. Like what is OpenFile supposed to return if it's given a bad file name?