Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Several Inaccuracies' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Several Inaccuracies
Authored by: Hal Itosis on Oct 28, '08 10:35:50AM
@GaelicWizard:
For example, the group of a file/folder is ALWAYS the "gid" of the user account. The group id is not inherited from its parent folder. You can test this by creating a folder and setting the group to admin instead of staff. Then, open that folder and create a file. Notice that the group of the folder is staff, not admin.
"ALWAYS the gid of the user account"?

That is false. Under Unix, the file created usually *does* get its gid from the parent. If you used TextEdit (or some other Apple app) to "create" the file, then that app can assign whatever group it wants. (in the case of TextEdit, it does its work on a file in a temporary directory first, and then copies the edited file over after (including gid apparently), thus erasing the original file (check the inode numbers). In Tiger, everything saved by TextEdit or Safari went into the wheel group. In Leopard now, those two apps always force staff as the group.

Here is a demo of files deriving their gid from the parent (using Terminal):

$ id -u; id -g
501
501
$ cd ~/Desktop
$ mkdir -v testgid
testgid
$ cd testgid; ls -ldn
drwxr-xr-x  2 501  501  68 Oct 28 13:04 .
$ chgrp admin .; ls -ldn
drwxr-xr-x  2 501  80  68 Oct 28 13:04 .
$ touch foo; ls -ln
total 0
-rw-r--r--  1 501  80  0 Oct 28 13:06 foo
$ chgrp staff .; ls -ldn
drwxr-xr-x  3 501  20  102 Oct 28 13:06 .
$ touch baz; ls -ln
total 0
-rw-r--r--  1 501  20  0 Oct 28 13:06 baz
-rw-r--r--  1 501  80  0 Oct 28 13:06 foo

Please fix the hint above with the information here in the comments, or pull it since it is providing wrong information on an already complex topic.
If robg had to pull every hint containing errors, there would be almost nothing left.
The comments typically serve that purpose (flawed that they too might be).

-HI-

[ Reply to This | # ]