Jump to: navigation, search

Php lchgrp

From w3cyberlearnings

Contents

PHP function lchgrp

This function changes to a new group ownership of symbolic link.

Syntax lchgrp

  • link is a symbolic link created by symlink() function.
  • group is a group id or name.
lchgrp(link, group);

Return

Returns TRUE on success or FALSE on failure.

Example 1

<?php 
 $link ='marks.html'; // is the symbolic link
 lcgroup($link,88);
?>

Example 2

create symbolic link

<?php 
  $target ='glob.php';
  $link = 'glob3i.html';
// create symbolic link
  symlink($target, $link);

// get symbolic information
  $lstat = lstat($link);

// display information
  print_r(array_slice($lstat, 13));

?>

use lchgrp function to change symblic link group id

<?php 
  $link = 'glob3i.html';
  lchgrp($link,1003); // change to 1003
  $lstat = lstat($link);
  print_r(array_slice($lstat, 13));  

?>

Output

Array
(
    [dev] => 2049
    [ino] => 213212
    [mode] => 41471
    [nlink] => 1
    [uid] => 0
    [gid] => 1003
    [rdev] => 0
    [size] => 8
    [atime] => 1339363406
    [mtime] => 1339363323
    [ctime] => 1339363406
    [blksize] => 4096
    [blocks] => 0
)

Related Links


basename-- chgrp-- chmod-- chown-- clearstatcache-- copy-- delete-- dirname-- disk_free_space-- disk_total_space-- diskfreespace-- fclose-- feof-- fflush-- fgetc-- fgetcsv-- fgets-- fgetss-- file_exists-- file_get_contents-- file_put_contents- file-- fileatime-- filectime-- filegroup-- fileinode-- filemtime-- fileowner-- fileperms-- filesize-- filetype-- flock-- fnmatch-- fopen-- fpassthru-- fputcsv-- fputs-- fread-- fscanf-- fseek-- fstat-- ftell-- ftruncate-- fwrite-- glob-- is_dir-- is_executable-- is_file-- is_link-- is_readable-- is_uploaded_file-- is_writable-- is_writeable-- lchgrp-- lchown-- link-- linkinfo-- lstat-- mkdir-- move_uploaded_file-- parse_ini_file-- parse_ini_string-- pathinfo-- pclose-- popen-- readfile-- readlink-- realpath_cache_get-- realpath_cache_size-- realpath-- rename-- rewind-- rmdir-- set_file_buffer-- stat-- symlink-- tempnam-- tmpfile-- touch-- umask-- unlink--

Navigation
Web
SQL
MISC
References