Index: trunk/src_plugins/export_bom/bom.c =================================================================== --- trunk/src_plugins/export_bom/bom.c (revision 27072) +++ trunk/src_plugins/export_bom/bom.c (revision 27073) @@ -239,7 +239,7 @@ } PCB_END_LOOP; - fp = pcb_fopen(&PCB->hidlib, bom_filename, "w"); + fp = pcb_fopen_askovr(&PCB->hidlib, bom_filename, "w", NULL); if (!fp) { pcb_message(PCB_MSG_ERROR, "Cannot open file %s for writing\n", bom_filename); print_and_free(NULL, bom); Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 27072) +++ trunk/src_plugins/export_dsn/dsn.c (revision 27073) @@ -505,7 +505,7 @@ { FILE *fp; /* Print out the dsn .dsn file. */ - fp = pcb_fopen(&PCB->hidlib, dsn_filename, "w"); + fp = pcb_fopen_askovr(&PCB->hidlib, dsn_filename, "w", NULL); if (!fp) { pcb_message(PCB_MSG_WARNING, "Cannot open file %s for writing\n", dsn_filename); return 1; Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 27072) +++ trunk/src_plugins/export_dxf/dxf.c (revision 27073) @@ -288,7 +288,7 @@ filename = "pcb.dxf"; if (dxf_cam.fn_template == NULL) { - dxf_ctx.f = pcb_fopen(&PCB->hidlib, dxf_cam.active ? dxf_cam.fn : filename, "wb"); + dxf_ctx.f = pcb_fopen_askovr(&PCB->hidlib, dxf_cam.active ? dxf_cam.fn : filename, "wb", NULL); if (!dxf_ctx.f) { perror(filename); return; @@ -361,7 +361,7 @@ fclose(dxf_ctx.f); } - dxf_ctx.f = pcb_fopen(&PCB->hidlib, dxf_cam.fn, "wb"); + dxf_ctx.f = pcb_fopen_askovr(&PCB->hidlib, dxf_cam.fn, "wb", NULL); if (!dxf_ctx.f) { perror(dxf_cam.fn); return 0; Index: trunk/src_plugins/export_excellon/excellon.c =================================================================== --- trunk/src_plugins/export_excellon/excellon.c (revision 27072) +++ trunk/src_plugins/export_excellon/excellon.c (revision 27073) @@ -106,7 +106,7 @@ void pcb_drill_export_excellon(pcb_board_t *pcb, pcb_drill_ctx_t *ctx, int force_g85, int coord_fmt_idx, const char *fn) { - FILE *f = pcb_fopen(&PCB->hidlib, fn, "wb"); /* Binary needed to force CR-LF */ + FILE *f = pcb_fopen_askovr(&PCB->hidlib, fn, "wb", NULL); /* Binary needed to force CR-LF */ coord_format_t *cfmt; if (f == NULL) { Index: trunk/src_plugins/export_fidocadj/fidocadj.c =================================================================== --- trunk/src_plugins/export_fidocadj/fidocadj.c (revision 27072) +++ trunk/src_plugins/export_fidocadj/fidocadj.c (revision 27073) @@ -191,7 +191,7 @@ if (!filename) filename = "pcb-rnd-default.fcd"; - f = pcb_fopen(&PCB->hidlib, filename, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, filename, "w", NULL); if (!f) { perror(filename); return; Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 27072) +++ trunk/src_plugins/export_gcode/gcode.c (revision 27073) @@ -469,7 +469,7 @@ BM_PUT(bm, r, c, p); } } - gcode_f2 = pcb_fopen(&PCB->hidlib, filename, "wb"); + gcode_f2 = pcb_fopen_askovr(&PCB->hidlib, filename, "wb", NULL); if (!gcode_f2) { perror(filename); gds_uninit(&tmp_ln); @@ -517,7 +517,7 @@ d = 0; drill = sort_drill(drill, n_drill); sprintf(filename, "%s.drill.cnc", gcode_basename); - gcode_f2 = pcb_fopen(&PCB->hidlib, filename, "wb"); + gcode_f2 = pcb_fopen_askovr(&PCB->hidlib, filename, "wb", NULL); if (!gcode_f2) { perror(filename); gds_uninit(&tmp_ln); Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 27072) +++ trunk/src_plugins/export_gerber/gerber.c (revision 27073) @@ -69,6 +69,7 @@ static int want_cross_sect; static int has_outline; static int gerber_debug; +static int gerber_ovr; static aperture_list_t *layer_aptr_list; @@ -520,6 +521,8 @@ int save_ons[PCB_MAX_LAYER]; pcb_hid_expose_ctx_t ctx; + gerber_ovr = 0; + conf_force_set_bool(conf_core.editor.thin_draw, 0); conf_force_set_bool(conf_core.editor.thin_draw_poly, 0); conf_force_set_bool(conf_core.editor.check_planes, 0); @@ -779,7 +782,7 @@ pagecount++; assign_file_suffix(filesuff, group, layer, flags, purpose, purpi, 0, NULL); if (f == NULL) { /* open a new file if we closed the previous (cam mode: only one file) */ - f = pcb_fopen(&PCB->hidlib, gerber_cam.active ? gerber_cam.fn : filename, "wb"); /* Binary needed to force CR-LF */ + f = pcb_fopen_askovr(&PCB->hidlib, gerber_cam.active ? gerber_cam.fn : filename, "wb", &gerber_ovr); /* Binary needed to force CR-LF */ if (f == NULL) { pcb_message(PCB_MSG_ERROR, "Error: Could not open %s for writing.\n", filename); return 1; Index: trunk/src_plugins/export_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/export_ipcd356/ipcd356.c (revision 27072) +++ trunk/src_plugins/export_ipcd356/ipcd356.c (revision 27073) @@ -451,7 +451,7 @@ if (fn == NULL) fn = "pcb-rnd-out.net"; - f = pcb_fopen(&PCB->hidlib, fn, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, fn, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "Can't open %s for write\n", fn); return; Index: trunk/src_plugins/export_oldconn/oldconn.c =================================================================== --- trunk/src_plugins/export_oldconn/oldconn.c (revision 27072) +++ trunk/src_plugins/export_oldconn/oldconn.c (revision 27073) @@ -249,7 +249,7 @@ if (response != 1) return NULL; } - if ((fp = pcb_fopen(&PCB->hidlib, Filename, "w")) == NULL) + if ((fp = pcb_fopen_askovr(&PCB->hidlib, Filename, "w", NULL)) == NULL) pcb_open_error_message(Filename); } return fp; Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 27072) +++ trunk/src_plugins/export_openems/export_openems.c (revision 27073) @@ -89,6 +89,7 @@ static FILE *f = NULL; static wctx_t *ems_ctx; +static int openems_ovr; #define THMAX PCB_MM_TO_COORD(100) @@ -638,6 +639,8 @@ int i, len; FILE *fsim; + openems_ovr = 0; + if (!options) { openems_get_export_options(hid, 0); for (i = 0; i < NUM_OPTIONS; i++) @@ -649,7 +652,7 @@ if (!filename) filename = "pcb.m"; - f = pcb_fopen(&PCB->hidlib, filename, "wb"); + f = pcb_fopen_askovr(&PCB->hidlib, filename, "wb", &openems_ovr); if (!f) { perror(filename); return; @@ -663,7 +666,7 @@ if (strcmp(end, ".m") != 0) end = runfn + len; strcpy(end, ".sim.m"); - fsim = pcb_fopen(&PCB->hidlib, runfn, "wb"); + fsim = pcb_fopen_askovr(&PCB->hidlib, runfn, "wb", &openems_ovr); if (fsim == NULL) { perror(runfn); return; Index: trunk/src_plugins/export_openems/mesh.c =================================================================== --- trunk/src_plugins/export_openems/mesh.c (revision 27072) +++ trunk/src_plugins/export_openems/mesh.c (revision 27073) @@ -968,7 +968,7 @@ default_file = pcb_strdup(fname); } - f = pcb_fopen(&PCB->hidlib, fname, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, fname, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "Can not open '%s' for write\n", fname); return; Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 27072) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 27073) @@ -308,7 +308,7 @@ if (!filename) filename = "pcb.openscad"; - f = pcb_fopen(&PCB->hidlib, filename, "wb"); + f = pcb_fopen_askovr(&PCB->hidlib, filename, "wb", NULL); if (!f) { perror(filename); return; @@ -600,7 +600,7 @@ PCB_ACT_CONVARG(1, FGW_STR, scad_export_poly, name = argv[1].val.str); - f = pcb_fopen(&PCB->hidlib, name, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, name, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "Failed to open %s for writing\n", name); PCB_ACT_IRES(-1); Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 27072) +++ trunk/src_plugins/export_png/png.c (revision 27073) @@ -1138,7 +1138,7 @@ } if (!png_cam.fn_template) { - f = pcb_fopen(&PCB->hidlib, png_cam.active ? png_cam.fn : filename, "wb"); + f = pcb_fopen_askovr(&PCB->hidlib, png_cam.active ? png_cam.fn : filename, "wb", NULL); if (!f) { perror(filename); return; @@ -1305,7 +1305,7 @@ png_foot(); fclose(f); } - f = pcb_fopen(&PCB->hidlib, png_cam.fn, "wb"); + f = pcb_fopen_askovr(&PCB->hidlib, png_cam.fn, "wb", NULL); if (!f) { perror(filename); return 0; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 27072) +++ trunk/src_plugins/export_ps/eps.c (revision 27073) @@ -333,7 +333,7 @@ filename = "pcb-out.eps"; if (eps_cam.fn_template == NULL) { - f = pcb_fopen(&PCB->hidlib, eps_cam.active ? eps_cam.fn : filename, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, eps_cam.active ? eps_cam.fn : filename, "w", NULL); if (!f) { perror(filename); return; @@ -379,7 +379,7 @@ eps_print_footer(f); fclose(f); } - f = pcb_fopen(&PCB->hidlib, eps_cam.fn, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, eps_cam.fn, "w", NULL); eps_print_header(f, eps_cam.fn); } Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 27072) +++ trunk/src_plugins/export_ps/ps.c (revision 27073) @@ -337,6 +337,7 @@ pcb_bool is_paste; pcb_composite_op_t drawing_mode; + int ovr_all; } global; static pcb_export_opt_t *ps_get_export_options(pcb_hid_t *hid, int *n) @@ -500,7 +501,7 @@ return NULL; if (!global.multi_file) - return pcb_fopen(&PCB->hidlib, base, "w"); + return pcb_fopen_askovr(&PCB->hidlib, base, "w", NULL); buf = (char *) malloc(strlen(base) + strlen(which) + 5); @@ -513,7 +514,7 @@ else { sprintf(buf, "%s.%s.ps", base, which); } - ps_open_file = pcb_fopen(&PCB->hidlib, buf, "w"); + ps_open_file = pcb_fopen_askovr(&PCB->hidlib, buf, "w", &global.ovr_all); free(buf); return ps_open_file; } @@ -612,6 +613,8 @@ int save_ons[PCB_MAX_LAYER]; int i; + global.ovr_all = 0; + if (!options) { ps_get_export_options(hid, 0); for (i = 0; i < NUM_OPTIONS; i++) Index: trunk/src_plugins/export_stat/stat.c =================================================================== --- trunk/src_plugins/export_stat/stat.c (revision 27072) +++ trunk/src_plugins/export_stat/stat.c (revision 27073) @@ -152,7 +152,7 @@ if (!filename) filename = "pcb.stat.lht"; - f = pcb_fopen(&PCB->hidlib, filename, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, filename, "w", NULL); if (!f) { perror(filename); return; Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 27072) +++ trunk/src_plugins/export_svg/svg.c (revision 27073) @@ -345,7 +345,7 @@ if (!filename) filename = "pcb.svg"; - f = pcb_fopen(&PCB->hidlib, svg_cam.active ? svg_cam.fn : filename, "wb"); + f = pcb_fopen_askovr(&PCB->hidlib, svg_cam.active ? svg_cam.fn : filename, "wb", NULL); if (!f) { perror(filename); return; @@ -395,7 +395,7 @@ fclose(f); } - f = pcb_fopen(&PCB->hidlib, svg_cam.fn, "wb"); + f = pcb_fopen_askovr(&PCB->hidlib, svg_cam.fn, "wb", NULL); if (f == NULL) { perror(svg_cam.fn); return 0; Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 27072) +++ trunk/src_plugins/export_xy/xy.c (revision 27073) @@ -664,7 +664,7 @@ FILE *fp; subst_ctx_t ctx; - fp = pcb_fopen(&PCB->hidlib, xy_filename, "w"); + fp = pcb_fopen_askovr(&PCB->hidlib, xy_filename, "w", NULL); if (!fp) { pcb_message(PCB_MSG_ERROR, "Cannot open file %s for writing\n", xy_filename); return 1; Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 27072) +++ trunk/src_plugins/io_lihata/write.c (revision 27073) @@ -1625,7 +1625,7 @@ lht_doc_t *doc; - f = pcb_fopen(&PCB->hidlib, Filename, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, Filename, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "Failed to open font file %s for write\n", Filename); return -1; Index: trunk/src_plugins/io_tedax/footprint.c =================================================================== --- trunk/src_plugins/io_tedax/footprint.c (revision 27072) +++ trunk/src_plugins/io_tedax/footprint.c (revision 27073) @@ -306,7 +306,7 @@ int res; FILE *f; - f = pcb_fopen(&PCB->hidlib, fn, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, fn, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "tedax_fp_save(): can't open %s for writing\n", fn); return -1; Index: trunk/src_plugins/io_tedax/stackup.c =================================================================== --- trunk/src_plugins/io_tedax/stackup.c (revision 27072) +++ trunk/src_plugins/io_tedax/stackup.c (revision 27073) @@ -333,7 +333,7 @@ FILE *f; tedax_stackup_t ctx; - f = pcb_fopen(&PCB->hidlib, fn, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, fn, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "tedax_stackup_save(): can't open %s for writing\n", fn); return -1; Index: trunk/src_plugins/io_tedax/tboard.c =================================================================== --- trunk/src_plugins/io_tedax/tboard.c (revision 27072) +++ trunk/src_plugins/io_tedax/tboard.c (revision 27073) @@ -256,7 +256,7 @@ int res; FILE *f; - f = pcb_fopen(&PCB->hidlib, fn, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, fn, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "tedax_board_save(): can't open %s for writing\n", fn); return -1; Index: trunk/src_plugins/io_tedax/tdrc.c =================================================================== --- trunk/src_plugins/io_tedax/tdrc.c (revision 27072) +++ trunk/src_plugins/io_tedax/tdrc.c (revision 27073) @@ -77,7 +77,7 @@ int res; FILE *f; - f = pcb_fopen(&PCB->hidlib, fn, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, fn, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "tedax_drc_save(): can't open %s for writing\n", fn); return -1; Index: trunk/src_plugins/io_tedax/tlayer.c =================================================================== --- trunk/src_plugins/io_tedax/tlayer.c (revision 27072) +++ trunk/src_plugins/io_tedax/tlayer.c (revision 27073) @@ -129,7 +129,7 @@ int res; FILE *f; - f = pcb_fopen(&PCB->hidlib, fn, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, fn, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "tedax_layer_save(): can't open %s for writing\n", fn); return -1; Index: trunk/src_plugins/io_tedax/tnetlist.c =================================================================== --- trunk/src_plugins/io_tedax/tnetlist.c (revision 27072) +++ trunk/src_plugins/io_tedax/tnetlist.c (revision 27073) @@ -205,7 +205,7 @@ int res; FILE *f; - f = pcb_fopen(&PCB->hidlib, fn, "w"); + f = pcb_fopen_askovr(&PCB->hidlib, fn, "w", NULL); if (f == NULL) { pcb_message(PCB_MSG_ERROR, "tedax_net_save(): can't open %s for writing\n", fn); return -1; Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 27072) +++ trunk/src_plugins/renumber/renumber.c (revision 27073) @@ -116,7 +116,7 @@ } } - if ((out = pcb_fopen(&PCB->hidlib, name, "w")) == NULL) { + if ((out = pcb_fopen_askovr(&PCB->hidlib, name, "w", NULL)) == NULL) { pcb_message(PCB_MSG_ERROR, "Could not open %s\n", name); if (free_name && name) free((char*)name);