的umask值为457,它应为w,x,-210666-457,但相反,我将其视为w,w,-..220这是为什么?

问题描述

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

有帮助吗?