Changes the file permissions of the specified file.
#include <sys/stat.h> int chmod ( const char *path, mode_t mode);
(IN) Specifies the file.
(IN) Specifies the permission mode for the file, or on NetWare file systems, file and directory attributes (see File Access Modes and NetWare Attributes).
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:
The various mode settings are defined in the sys/mode.h header file and are described in File Access Modes and NetWare Attributes.
On NetWare file systems, you can use chmod to set file and directory attributes. If the M_A_BITS_SIGNIFICANT is set in the mode parameter, it means that the mode is being used to set the file and directory attributes. This functionality is mutually-exclusive of the normal chmod functionality:
If the M_A_BITS_SIGNIFICANT bit is set, only the NetWare-specific attribute bits are used and the user, group, and other flags are ignored.
If it is not set, the NetWare-specific flags are not examined.