Parametrised output directory.  Conditional creation of output directory.