/sys/doc/ Documentation archive



CHMOD(II)                    12/15/74                   CHMOD(II)



NAME
     chmod - change mode of file

SYNOPSIS
     (chmod = 15.)
     sys chmod; name; mode

     chmod(name, mode)
     char *name;

DESCRIPTION
     The  file  whose name is given as the null-terminated string
     pointed to by name has its mode changed to mode.  Modes  are
     constructed  by  ORing together some combination of the fol-
     lowing:

         4000 set user ID on execution
         2000 set group ID on execution
         1000 save text image after execution
         0400 read by owner
         0200 write by owner
         0100 execute (search on directory) by owner
         0070 read, write, execute (search) by group
         0007 read, write, execute (search) by others

     Only the owner of a file (or the super-user) may change  the
     mode.  Only the super-user can set the 1000 mode.

SEE ALSO
     chmod(I)

DIAGNOSTIC
     Error  bit (c-bit) set if name cannot be found or if current
     user is neither the owner of the file  nor  the  super-user.
     From  C, a -1 returned value indicates an error, 0 indicates
     success.





















                              - 1 -