The following code changes the file mode
for the file identified by pathname.
For the callable service, see
chmod (BPX1CHM, BPX4CHM) — Change the mode of a file or directory. For the data structure,
see
BPXYMODE — Map the mode constants of the file services. AMODE
64 callers use
BPX4CHM (chmod) example.
MVC BUFFERA(26),=CL26'newprogs/path/eightfold.c'
MVC BUFLENA,=F'26'
XC S_MODE,S_MODE
MVI S_MODE2,S_IRUSR All read and write
MVI S_MODE3,S_IWUSR+S_IRGRP+S_IWGRP+S_IROTH+S_IWOTH
SPACE ,
CALL BPX1CHM, Change File Modes +
(BUFLENA, Input: Pathname length +
BUFFERA, Input: Pathname +
S_MODE, Input: Mode, mapped by BPXYMODE +
RETVAL, Return value: 0 or -1 +
RETCODE, Return code +
RSNCODE), Reason code +
VL,MF=(E,PLIST) ----------------------------------