PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

chmod> <basename
Last updated: Mon, 26 Nov 2007

view this page in

chgrp

(PHP 4, PHP 5)

chgrp — 改变文件所属的组

说明

bool chgrp ( string $filename , mixed $group )

尝试将文件 filename 所属的组改成 group (通过组名或组 ID 指定)。只有超级用户可以任意修改文件的组,其它用户可能只能将文件的组改成该用户自己所在的组。

如果成功则返回 TRUE,失败则返回 FALSE

Note: 本函数不能作用于远程文件,被检查的文件必须通过服务器的文件系统访问。

Note: 安全模式被激活时,PHP 将检查被操作的文件或者目录是否与正在执行的脚本有相同的 UID(所有者)。

参见 chown()chmod()



add a note add a note User Contributed Notes
chgrp
Dan Dascalescu
04-Dec-2007 09:12
If you call chgrp and pass a non-existent group, you'll get the warning "Warning: chgrp(): Unable to find gid for nogroup in".

To check beforehand if the group exists, use posix_getgrid() or posix_getgrnam().

chmod> <basename
Last updated: Mon, 26 Nov 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites