Flexibility for _with functions, ensure dir exists.