文件模式的常量


以下常量适用于 fs.Stats 对象的 mode 属性,用于决定文件的访问权限。

常量 说明
S_IRWXU 表明所有者可读、可写、可执行。
S_IRUSR 表明所有者可读。
S_IWUSR 表明所有者可写。
S_IXUSR 表明所有者可执行。
S_IRWXG 表明群组可读、可写、可执行。
S_IRGRP 表明群组可读。
S_IWGRP 表明群组可写。
S_IXGRP 表明群组可执行。
S_IRWXO 表明其他人可读、可写、可执行。
S_IROTH 表明其他人可读。
S_IWOTH 表明其他人可写。
S_IXOTH 表明其他人可执行。

The following constants are meant for use with the fs.Stats object's mode property for determining the access permissions for a file.

Constant Description
S_IRWXU File mode indicating readable, writable, and executable by owner.
S_IRUSR File mode indicating readable by owner.
S_IWUSR File mode indicating writable by owner.
S_IXUSR File mode indicating executable by owner.
S_IRWXG File mode indicating readable, writable, and executable by group.
S_IRGRP File mode indicating readable by group.
S_IWGRP File mode indicating writable by group.
S_IXGRP File mode indicating executable by group.
S_IRWXO File mode indicating readable, writable, and executable by others.
S_IROTH File mode indicating readable by others.
S_IWOTH File mode indicating writable by others.
S_IXOTH File mode indicating executable by others.