support custom file and dir creation modes