write to a configurable base_dir folder