Home Menu

chgrp

Changes file group

Syntax

chgrp ( string $filename , mixed $group ) : bool

Parameters

filename

Path to the file.

group

A group name or number.

Return

Returns TRUE on success or FALSE on failure.

Examples

<?

$format = "filename: %s\ndate: %s\ngroup: %d\n";
$filename = 'file.txt';

printf($format, $filename, date('r'), filegroup($filename));

$group = 8;
chgrp($filename, $group);
clearstatcache(); // do not cache filegroup() results

printf($format, $filename, date('r'), filegroup($filename));

?>
filename: file.txt
date: Sun, 25 Jul 2021 10:18:26 +0000
group: 0
filename: file.txt
date: Sun, 25 Jul 2021 10:18:26 +0000
group: 8

PHP

JesusBible
HTMLCSSJSPHPSVGMore
AboutTerms