array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.chgrp.php', 1 => 'chgrp', ), 'up' => array ( 0 => 'ref.filesystem.php', 1 => 'Dosya Sistemi İşlevleri', ), 'prev' => array ( 0 => 'function.basename.php', 1 => 'basename', ), 'next' => array ( 0 => 'function.chmod.php', 1 => 'chmod', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'tr', 'path' => 'reference/filesystem/functions/chgrp.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
chgrp — Dosya grubunu değiştirir
dosyaismi
ile belirtilen dosyanın grubunu
grup
yapmaya çalışır.
Bir dosyanın grubunu keyfi olarak sadece root değiştirebilir; diğer kullanıcılar sadece sahibi oldukları bir dosyanın grubunu üyesi oldukları gruplarla değiştirebilirler.
dosyaismi
Dosya yolu.
grup
Grup ismi veya numarası.
Örnek 1 - Bir dosyanın grubunun değiştirilmesi
<?php
$filename = 'shared_file.txt';
$format = "%s's Group ID @ %s: %d\n";
printf($format, $filename, date('r'), filegroup($filename));
chgrp($filename, 8);
printf($format, $filename, date('r'), filegroup($filename));
?>
Bilginize: Dosyaların sunucunun dosya sistemi üzerinden erişilebilir olması gerektiğinden bu işlev uzak dosyalar üzerinde çalışmayacaktır.
Bilginize: Windows'ta, bu işlev normal bir dosyaya uygulandığında sessizce başarısız olur.