gtpo1m5nOperations

ZFILE chmod-Change the Access Permissions of a File or Directory

Use this command to change the access permissions of a file or directory. The access permissions determine who can read, write, or search a file or directory.

Note:
In a program, you can set the access permissions of a file or directory with the chmod function.

Requirements and Restrictions

Format




-R
recursively changes the access permissions of the specified file or directory. If you specify a directory, the access permissions of all files and subdirectories under that directory are changed. If you do not specify this parameter, the access permissions for only the specified file or directory are changed.

permission
is the permission setting specified in octal notation. Specify this permission setting by adding the following values:

4000
sets the effective user ID (UID) of the process that executes the file. In the chmod function, this value is S_ISUID. This setting has no effect on directories.

2000
sets the effective group ID (GID) of the process that executes the file. In the chmod function, this value is S_ISGID. If you set this value for a directory, all files created in that directory will have the same GID of that directory.

0400
allows the owner to read the file or directory. In the chmod function, this value is S_IRUSR.

0200
allows the owner to write to the file or directory. In the chmod function, this value is S_IWUSR.

0100
allows the owner to execute (or run) the file or search the directory. In the chmod function, this value is S_IXUSR. Specify this permission only for directories or regular files; you cannot set this permission for special files.

0040
allows the group to read the file or directory. In the chmod function, this value is S_IRGRP.

0020
allows the group to write to the file or directory. In the chmod function, this value is S_IWGRP.

0010
allows the group to execute (or run) the file or search the directory. In the chmod function, this value is S_IXGRP. Specify this permission only for directories or regular files; you cannot set this permission for special files.

0004
allows others to read the file or directory. In the chmod function, this value is S_IROTH.

0002
allows others to write to the file or directory. In the chmod function, this value is S_IWOTH.

0001
allows others to execute (or run) the file or search the directory. In the chmod function, this value is S_IXOTH. Specify this permission only for directories or regular files; you cannot set this permission for special files.

For example, to set the access permissions to allow the owner to read, write, and execute the file, and to allow the group and others to read and execute the file, specify 755 for permission.

Note:
You do not have to specify the leading zeros for the access permission values.

path
is the path name of the file or directory whose access permissions you are changing.

Additional Information

Examples

In the following example, the access permissions for /tmp/sample.1 are set to read and write by owner and group.

+---------------------------------------------------------------------------------------------+
|User:   ZFILE chmod 0660 /tmp/sample.1                                                       |
|                                                                                             |
|System: FILE0003I 15.26.53 chmod 0660 ... COMPLETED SUCCESSFULLY. NO OUTPUT TO DISPLAY       |
+---------------------------------------------------------------------------------------------+

Related Information