Posted By: TehV
file_open_write appends to file content - 03/01/14 14:52
Hi,
I have a function that writes contents to an XML file. I appear to have hit a roadblock since the program appends to the XML file instead of overwriting the existing content.
This is the relevant code:
Anyone have any ideas?
I have a function that writes contents to an XML file. I appear to have hit a roadblock since the program appends to the XML file instead of overwriting the existing content.
This is the relevant code:
Code:
function writeXML() { var file = file_open_write("out_info.xml"); STRING* str = ""; str_cat(str,"<out_info>\n\t"); str_cat_num(str,"<tasks_total>%.0f</tasks_total>\n\t",totaltasks); str_cat_num(str,"<current_task>%.0f</current_task>\n\t",current_task); str_cat_num(str,"<frame_rate>%.0f</frame_rate>\n\t",fps_snap); str_cat_num(str,"<do_mode>%.0f</do_mode>\n",runmode); str_cat(str,"</out_info>"); file_str_write(file,str); file_close(file); }
Anyone have any ideas?