It would be good to provide an interface to the POSIX umask function. Also, it would be handy if we could provide an umasked-chmod function.
I have to say that I have always hated the octal form of this API. If we support this, I hope we can include something like chmod's symbolic syntax, e.g. umask(u="rw",g="r",o=""). (We can support the octal/numeric codes too, I would just hate for this to be the only API.)
Agree – I like the proposal for the API, although I guess I would spell out the keywords:
umask(user="rw", group="r", o="")
The same kind of API should probably apply to chmod and there we could potentially support a UNIX-like "+rw" kind of scheme as well as recursion.
Note: Windows has _umask_s, the "Security-Enhancedâ„¢" version.
Most helpful comment
I have to say that I have always hated the octal form of this API. If we support this, I hope we can include something like chmod's symbolic syntax, e.g.
umask(u="rw",g="r",o=""). (We can support the octal/numeric codes too, I would just hate for this to be the only API.)