I have a customized version of the save_file function so that whenever I save a file it gets backed up to my google drive. I recently added some code to make it also make a copy in a OneDrive folder. For some reason in the OneDrive folder I'm getting a bunch of duplicated files with date and time added to the name. I have no clue where these files are coming from. Is it possible OneDrive is creating them? How do I figure this out?
25/02/2018 00:14 12,623 psu.c
24/02/2018 23:52 1,028 psu.c2018-02-24 2351
24/02/2018 23:55 12,014 psu.c2018-02-24 2354
24/02/2018 23:58 12,210 psu.c2018-02-24 2358
24/02/2018 23:59 12,266 psu.c2018-02-24 2359
_str save_file(_str filename,_str options)
{
#if 0
int renumber_flags=numbering_options();
if (renumber_flags&VSRENUMBER_AUTO) {
if (renumber_flags&VSRENUMBER_COBOL) {
renumber_lines(1,6,'0',false,true);
}
if (renumber_flags&VSRENUMBER_STD) {
renumber_lines(73,80,'0',false,true);
}
}
#endif
typeless status=_save_file(options " "_maybe_quote_filename(filename));
if (!status && file_eq(strip(filename,'B','"'),p_buf_name)) {
if (p_modified_temp_name!='') {
_as_removefilename(p_modified_temp_name,true);
p_modified_temp_name='';
}
//_cbsave_filewatch();
#if 1
call_list('_cbsave_');
//10:51am 7/3/1997
//Dan modified for auto-tagging
if (def_autotag_flags2&AUTOTAG_ON_SAVE) {
//messageNwait(nls('got here'));
TagFileOnSave();
}
#endif
}
_str pa = 'C:\Users\GP\Google Drive\slick\copy-on-save\' :+ strip_filename(filename,'DN');
if (!path_exists(pa)) {
int result = make_path(pa);
if (result) {
_message_box("slick backup make path failed : " :+ result :+ pa);
return status;
}
}
int result2 = copy_file(filename, pa :+ strip_filename(filename,'P'));
if (result2 != 0) {
_message_box("slick backup main google drive copy failed " :+ (_str)(result2));
}
int result = copy_file(filename, 'C:\Users\GP\OneDrive\slick-copy-on-save\' :+ strip_filename(filename,'P'));
if (result != 0) {
_message_box("slick backup main one drive copy failed " :+ (_str)(result));
}
return(status);
}