Avoid duplicating this complexity in too many places. At the same time make the interface more identical to regular mkdir(), for familiarity.