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().
chgrp
(PHP 4, PHP 5)
chgrp — ファイルのグループを変更する
説明
bool chgrp
( string $filename
, mixed $group
)
(名前または番号で指定した)ファイル filename のグループを group に変更しようと試みます。
スーパーユーザのみがファイルのグループを任意に変更できます。 その他のユーザは、ファイルのグループをそのユーザがメンバーとして 属しているグループに変更できます。
パラメータ
- filename
-
ファイルへのパス。
- group
-
グループ名あるいはグループ番号。
返り値
成功した場合に TRUE を、失敗した場合に FALSE を返します。
chgrp
Dan Dascalescu
04-Dec-2007 10:12
04-Dec-2007 10:12