This patch changes fs::setPermissions to optionally set permissions while respecting the umask. It also adds the function fs::getUmask() which returns the current umask.
This change is not 100% necessary it doesn't need to be in lib/Support, but I am planning on using it for D62718. I figured I would test the waters on this one. Also, fs::getUmask() isn't necessary to have, I think that the change to fs::setPermissions would be enough, but I figured I would add it and remove later than the other way around.
I don't know if unnamed parameters are allowed per the style guide, it isn't used by the Windows version of this function, this was the thinking behind this.
I've added a couple of other reviewers who have made recent changes to the Path files.
It's not your fault, but this dance seems ridiculous.
Remove double-blank line.
I think this is fine.
You're capitalization of test names is inconsistent. One starts with a leading caps, and the other doesn't.
I think you also need a test case for explicit false for respectUmask.
Agreed, there are quite a few get/set syscalls, not sure why this needed to be the case for umask.
Yup sorry about that I should have looked over git clang-formats changes. It did not format the .inc files. This should be proper formatting now, I just copied how it is in the header file which clang-format did.
I think this is consistent with the rest of the file. getUmask is capitalized as such because it is testing a specific function, while RespectUmask is testing behavior. is_local test versus the ReadWriteFileCanReadOrWrite test.