Change the owner of a file
Integer_Type chown (String_Type file, Integer_Type uid, Integer_Type gid)
The chown
function is used to change the user-id and group-id of
file
to uid
and gid
, respectively. It returns
zero
upon success and -1
upon failure, with errno
set accordingly.
On most systems, only the super user can change the ownership of a file.
Some systems do not support this function.
chmod, stat_file