Chmod
change access permissions of a file
#include <modes.h>
chmod
char *fname
int perm
Description
Chmod changes the permission bits associated with a file.
"Fname" must be a pointer to a file name, and "perm" should
contain the desired bit pattern,
The allowable bit patterns are defined in the include file as follows:
/* permissions */
#define S_IREAD 0x01 /* owner read */
#define S_IWRITE 0x02 /* owner write */
#define S_IEXEC 0x04 /* owner execute */
#define S_IOREAD 0x08 /* public read */
#define S_IOWRITE 0x10 /* public write */
#define S_IOEXEC 0x20 /* public execute */
#define S_ISHARE 0x40 /* sharable */
#define S_IFDIR 0x80 /* directory */
Only the owner or the super user may change the permissions of
a file.
Diagnostics
A successful call returns 0. A -1 is returned if the
caller is not entitled to change permissions of "fname" cannot
be found.
See Also
OS-9 command "attr"