umask 值为 457 时,它应该是 w, x, - 210 (666-457),但我看到的是 w,w,-..(220)。这是为什么?

With a umask value of 457 it should come as w, x, - 210 (666-457) but instead i am seeing it as w,w,-..(220). why is that?

you can find the snapshot of the error here

如果 umask 值为 457,它应该是 w, x, - 210 (666-457) 但我看到的是 w,w,-..(220)。这是为什么?

让我们分解一下: umask 不做减法,而是按位运算。它通过关闭在 umask 上设置的前提中的位来工作,因此在这种情况下:

6: 110 4:100 -> 010 ->2
6: 110 1:101 -> 010 ->2
6: 110 7:111 -> 000 ->0

有帮助吗?