z/OS Using REXX and z/OS UNIX System Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


chmod()

z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00

Read syntax diagramSkip visual syntax diagram
>>-chmod--(--pathname--,--+-----------+--mode--)---------------><
                          '-operation-'            

Function

Changes the mode for the specified path name. It returns 0 if the mode for the specified path name is changed; otherwise, it returns the system call error number.

Parameters

pathname
An absolute or relative path name for a file.
operation
Specifies whether mode bits are to be set, added, or deleted:
=
Set the mode bits. If an operation is not specified, = is used.
+
Add the mode bits to what is currently set for the file.
-
Remove the mode bits from what is currently set for the file.
mode
A string of octal digits for the new file mode.

Example

To set permissions for owner and group to read-write:

call chmod file,660   
To add read permission for other:
call chmod file,+4  

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014