// copies a file only when the target file exists and the source file is newer
var file_refresh(STRING* to,STRING* from)
{
long date_to = file_date(to);
if (!to) return 0; // target file does not exist
long date_from = file_date(from);
if (date_from <= date_to) return 0; // source file is not newer
return file_cpy(to,from);
}
See also:
file_cpy, file_rename, file_delete