Index: trunk/src_plugins/cam/cam.c =================================================================== --- trunk/src_plugins/cam/cam.c (revision 18322) +++ trunk/src_plugins/cam/cam.c (revision 18323) @@ -39,6 +39,7 @@ #include "actions.h" #include "cam_conf.h" #include "compat_misc.h" +#include "compat_fs.h" #include "../src_plugins/cam/conf_internal.c" @@ -78,8 +79,28 @@ if (strcmp(cmd, "prefix") == 0) { + char *end; + free(ctx->prefix); ctx->prefix = pcb_strdup(arg); + + /* mkdir -p if there's a path sep in the prefix */ + end = strrchr(arg, PCB_DIR_SEPARATOR_C); + if (end == NULL) + return 0; + *end = '\0'; + + for(curr = arg; curr != NULL; curr = next) { + next = strrchr(curr, PCB_DIR_SEPARATOR_C); + if (next != NULL) + *next = '\0'; + pcb_mkdir(arg, 0755); + if (next != NULL) { + *next = PCB_DIR_SEPARATOR_C; + next++; + } + } + } else if (strcmp(cmd, "write") == 0) { int argc = ctx->argc; Index: trunk/src_plugins/cam/cam.conf =================================================================== --- trunk/src_plugins/cam/cam.conf (revision 18322) +++ trunk/src_plugins/cam/cam.conf (revision 18323) @@ -5,7 +5,6 @@ li:jobs { doc_png { plugin png --dpi 600 - prefix pina write top.png=top-copper,top-silk write bottom.png=bottom-copper,bottom-silk }