Re: getting the full user name
Re: getting the full user name
- Subject: Re: getting the full user name
- From: "John C. Randolph" <email@hidden>
- Date: Fri, 28 Oct 2005 23:17:08 -0700
On Oct 28, 2005, at 7:09 PM, Herbert wrote:
I need to build a list of users. Getting the short name is easy,
you can get the directory list from the Users directory.
I'd like to show the full names in the list. I found some source
for niutil that I guess will work, but I was wondering if there is
a Cocoa way to do it.
I see a method for getting the full name of the current user, but
not of anyone else.
Have I missed something?
Well, back in the Old Days, you could do this with the NetInfo
framework. Today, you could use NSTask to execute "nidump passwd .",
which will give you something like this:
nobody:*:-2:-2::0:0:Unprivileged User:/var/empty:/usr/bin/false
root:*:0:0::0:0:System Administrator:/var/root:/bin/sh
...
[snippage. You get the idea.]
...
securityagent:*:92:92::0:0:SecurityAgent:/var/empty:/usr/bin/false
jcr:********:501:501::0:0:John C. Randolph:/Users/jcr:/bin/bash
foo:********:502:502::0:0:foo:/Users/foo:/bin/bash
Any UIDs less than 500 are probably not real users, unless someone's
decided to go against the guidelines in Apple's sysadmin docs.
-jcr
John C. Randolph <email@hidden> (408) 914-0013
Roaming Cocoa Engineer,
Available for your projects at great Expense and Inconvenience.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden