template SiSUpod() { struct SDPsisupod { void sisupod_assemble( string fn_src, ) { mixin SiSUpaths; auto pth_sisupod = SiSUpodPaths(); mixin SiSUlanguageCodes; auto lang = Lang(); auto rgx = Rgx(); /+ dir structure /tmp/_sisu_processing_/ralph/en/sisupod ├── doc │ └── en └── image - create directory structure +/ assert (match(fn_src, rgx.src_fn)); try { /+ create directory structure +/ mkdirRecurse(pth_sisupod.doc(fn_src)); mkdirRecurse(pth_sisupod.conf(fn_src)); mkdirRecurse(pth_sisupod.css(fn_src)); mkdirRecurse(pth_sisupod.image(fn_src)); /+ copy relevant files +/ auto f_out = pth_sisupod.fn_doc(fn_src, "en"); // you need fn without path and then to insert back language code for output sub-directory debug(sisupod) { writeln(__LINE__, ": ", fn_src, " -> ", f_out); } mkdirRecurse(pth_sisupod.doc_lng(fn_src, "en")); // need to extract language code directories (from directory structure or filenames & have a default) copy(fn_src, f_out); } catch (ErrnoException ex) { // Handle error } } } }