当前位置: 技术问答>linux和unix
在LINUX下编C程序用chmod(filename,XXX)函数如何打开文件的所有权限?
来源: 互联网 发布时间:2014-12-31
本文导语: chmod(filename,XXX); //XXX为三位整数 请问参数XXX为多少,才能打开LINUX下文件的所有权限,权限值如 - rwxrwxrwx 在LINUX下用chmod命令加参数777就可以打开文件的所有权限,但在C程序中,参数设为777却无法打开所有权...
chmod(filename,XXX); //XXX为三位整数
请问参数XXX为多少,才能打开LINUX下文件的所有权限,权限值如 - rwxrwxrwx
在LINUX下用chmod命令加参数777就可以打开文件的所有权限,但在C程序中,参数设为777却无法打开所有权限,请哪位大虾知道的,告诉我一下这个参数值应该为多少,谢谢!!!
请问参数XXX为多少,才能打开LINUX下文件的所有权限,权限值如 - rwxrwxrwx
在LINUX下用chmod命令加参数777就可以打开文件的所有权限,但在C程序中,参数设为777却无法打开所有权限,请哪位大虾知道的,告诉我一下这个参数值应该为多少,谢谢!!!
|
up
S_ISUID 04000 set user ID on execution
S_ISGID 02000 set group ID on execution
S_ISVTX 01000 sticky bit
S_IRUSR (S_IREAD)
00400 read by owner
S_IWUSR (S_IWRITE)
00200 write by owner
S_IXUSR (S_IEXEC)
00100 execute/search by owner
S_IRGRP 00040 read by group
S_IWGRP 00020 write by group
S_IXGRP 00010 execute/search by group
S_IROTH 00004 read by others
S_IWOTH 00002 write by others
S_IXOTH 00001 execute/search by others
S_ISUID 04000 set user ID on execution
S_ISGID 02000 set group ID on execution
S_ISVTX 01000 sticky bit
S_IRUSR (S_IREAD)
00400 read by owner
S_IWUSR (S_IWRITE)
00200 write by owner
S_IXUSR (S_IEXEC)
00100 execute/search by owner
S_IRGRP 00040 read by group
S_IWGRP 00020 write by group
S_IXGRP 00010 execute/search by group
S_IROTH 00004 read by others
S_IWOTH 00002 write by others
S_IXOTH 00001 execute/search by others