enh: mode option now also applies to directories