• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finding out the user's group
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Finding out the user's group (From: Sean Gilbertson <email@hidden>)

  • Prev by Date: Re: status of cString (was const char* to char*)
  • Next by Date: NSWorkspace openFile:withApplication question
  • Previous by thread: Finding out the user's group
  • Next by thread: NSWorkspace openFile:withApplication question
  • Index(es):
    • Date
    • Thread