efilnikufecin
Member
I'm working on the script which will add to the seed data pulverize map and I have a quick question. I want to back-up the map file each time the script is initialized, and so I have written the following:
The problem is that if the script is initialized more than once in the same day, then it will overwrite the previous backup file which is not desirable. I would like for it to create a unique backup each time, and leave it for manual deletion later. Anyone have a clever work-around for this case?
Code:
record pulvdata_record
{
int samples;
int twinkly_wads;
int cold_wads;
int hot_wads;
int sleaze_wads;
int spooky_wads;
int stench_wads;
int twinkly_nuggets;
int cold_nuggets;
int hot_nuggets;
int sleaze_nuggets;
int spooky_nuggets;
int stench_nuggets;
int twinkly_powder;
int cold_powder;
int hot_powder;
int sleaze_powder;
int spooky_powder;
int stench_powder;
};
pulvdata_record[item] pulverise_data;
file_to_map( "pulv.txt", pulverise_data );
map_to_file( pulverise_data, "\\backup_maps\\pulv" + today_to_string() + ".txt");
The problem is that if the script is initialized more than once in the same day, then it will overwrite the previous backup file which is not desirable. I would like for it to create a unique backup each time, and leave it for manual deletion later. Anyone have a clever work-around for this case?