Closes GH-6176 This way for mode we return in an octal format which is immediately usable compared to transforming it later.