.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "GFS_CHMOD" "3" "13 November 2006" "Gfarm" ""
.SH NAME
gfs_chmod \- change permissions of a file
.SH SYNOPSIS
.sp
\fB#include
.sp
char *gfs_chmod (char * \fIgfarm_url\fB, mode_t \fImode\fB);
\fR
.SH "DESCRIPTION"
.PP
\fBgfs_chmod()\fR changes the mode of the file
given by \fIgfarm_url\fR\&. Permission bit masks of
\fImode\fR are similar to ones of mode parameter to
\fBchmod(2)\fR, though only the least 9 bit are
effective.
.PP
An executable file cannot be changed to a non-executable file
and vice versa, unless the number of fragment of the file is only one.
In detail, a file has multiple fragments with any execution bit should not
be changed to that with no execution bit. It is necessary to have
at least one execution bit. Similarly, a file has multiple fragments
with no execution bit should not be changed to that with any execution bit.
.SH "RETURN VALUES"
.TP
\fBNULL\fR
The function terminated successfully.
.TP
\fBGFARM_ERR_NO_MEMORY\fR
Insufficient memory was available.
.TP
\fBGFARM_ERR_AUTHENTICATION\fR
User authentication failed when connecting to gfmd(8) or gfsd(8).
.TP
\fBGFARM_ERR_PERMISSION_DENIED\fR
The parent directory of \fIgfarm_url\fR
did not allow write permission.
.TP
\fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR
The effective UID does not match the owner of the file, and is not
zero. Or an attempt was made to change an executable file with more than
one fragment to a non-executable file, or vice versa.
.TP
\fBGFARM_ERR_NO_SUCH_OBJECT\fR
The file does not exist.
.TP
\fBGFARM_ERR_NOT_A_DIRECTORY\fR
A component of the path prefix is not a directory.
.TP
\fBOthers\fR
An error except the above occurred. The reason is shown by its
pointed strings.