windows - What are file groups (changed using chgrp()) in PHP? -


i searched information on google couldn't find detailed. reading chgrp() , mentioned function can change file group.

there no explanation file group is. tried run example on reference page see if output me understand more function output seemed number zero. here example code:

$filename = 'stats.txt'; $format = "%s's group id @ : %d\n"; printf($format, $filename, filegroup($filename)); chgrp($filename, 10); clearstatcache(); // not cache filegroup() results printf($format, $filename, filegroup($filename)); 

here output of code:

stats.txt's group id : 0 stats.txt's group id : 0 

in unix, file ownership based on owner , group.

here's directory listing on linux box:

[vagrant@localhost:nginx]$ ls -l total 8 drwxrwxrwx. 1 vagrant vagrant  136 feb  5  2016 configs -rwxrwxrwx. 1 vagrant vagrant 1348 aug 19 07:34 docker-entrypoint.sh -rwxrwxrwx. 1 vagrant vagrant  786 feb  5  2016 dockerfile 

in case, file docker-entrypoint.sh owned user named "vagrant" , group named "vagrant".

permissions assigned 1 of 3 separate groups:

  • owner permissions
  • group permissions
  • other users

you focused on chgrp() function wrapper around linux chgrp api/command.

the groups on linux box can examined

cat /etc/group

the number @ end of each entry group number. can typically manipulate group membership using group name or number, in example, displaying group number apparently, there group name associated group.

[vagrant@localhost:nginx]$ cat /etc/group root:x:0: bin:x:1: daemon:x:2: sys:x:3: adm:x:4: tty:x:5: disk:x:6: lp:x:7: mem:x:8: 

there similarities , differences between windows , unix/mac systems aren't 100% equivalent. here's good article on topic.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -