Re: Finding out the user's group
Re: Finding out the user's group
- Subject: Re: Finding out the user's group
- From: Chris Ridd <email@hidden>
- Date: Fri, 28 Nov 2003 08:42:28 +0000
On 28/11/03 8:07 am, Sean Gilbertson <email@hidden> wrote:
>
All,
>
>
I'm interested in finding out the current user's group[s] (i.e.
>
"staff," "admin," etc.). There is NSUserName( ) for finding out the
>
user's name, but I couldn't find a function for group. I don't really
>
want to run "id," but if I could do that, I would, I suppose. Does
>
anyone know of a function to get group names/IDs for the current user?
Not in Cocoa, but BSD has calls that will give you this information. Look at
the man pages for getuid, getgid, getpwuid and getpwgid.
Hopefully those go through the appropriate Directory Services (?) mechanisms
to get the info from all the right places.
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.